Permalink
Browse files

[MSC-128] fix missing stability notifications

  • Loading branch information...
ropalka committed Feb 11, 2013
1 parent 61da841 commit 2133c229d2b891197abe67551c777e1360933607
Showing with 16 additions and 8 deletions.
  1. +16 −8 src/main/java/org/jboss/msc/service/ServiceControllerImpl.java
@@ -2009,10 +2009,14 @@ private void startFailed(StartException e, ServiceName serviceName, StartContext
StopTask(final boolean onlyUninject) {
this.onlyUninject = onlyUninject;
if (!onlyUninject && !ServiceControllerImpl.this.children.isEmpty()) {
- this.children = ServiceControllerImpl.this.children.toScatteredArray(NO_CONTROLLERS);
- // placeholder async task for child removal; last removed child will decrement this count
- // see removeChild method to verify when this count is decremented
- ServiceControllerImpl.this.asyncTasks ++;
+ synchronized (ServiceControllerImpl.this) {
+ final boolean leavingRestState = isStableRestState();
+ this.children = ServiceControllerImpl.this.children.toScatteredArray(NO_CONTROLLERS);
+ // placeholder async task for child removal; last removed child will decrement this count
+ // see removeChild method to verify when this count is decremented
+ ServiceControllerImpl.this.asyncTasks ++;
+ updateStabilityState(leavingRestState);
+ }
}
else {
this.children = null;
@@ -2192,10 +2196,14 @@ public void run() {
DependencyFailedTask(final Dependent[][] dependents, final boolean removeChildren) {
this.dependents = dependents;
if (removeChildren && !ServiceControllerImpl.this.children.isEmpty()) {
- this.children = ServiceControllerImpl.this.children.toScatteredArray(NO_CONTROLLERS);
- // placeholder async task for child removal; last removed child will decrement this count
- // see removeChild method to verify when this count is decremented
- ServiceControllerImpl.this.asyncTasks ++;
+ synchronized (ServiceControllerImpl.this) {
+ final boolean leavingRestState = isStableRestState();
+ this.children = ServiceControllerImpl.this.children.toScatteredArray(NO_CONTROLLERS);
+ // placeholder async task for child removal; last removed child will decrement this count
+ // see removeChild method to verify when this count is decremented
+ ServiceControllerImpl.this.asyncTasks ++;
+ updateStabilityState(leavingRestState);
+ }
}
else {
this.children = null;

0 comments on commit 2133c22

Please sign in to comment.