when timeouting, and closed, raise onClose and not onTimeout

This commit is contained in:
kimchy 2010-08-03 10:05:19 +03:00
parent de8ffaf5fb
commit 04781e038a
1 changed files with 5 additions and 1 deletions

View File

@ -240,7 +240,11 @@ public class InternalClusterService extends AbstractLifecycleComponent<ClusterSe
if (timeout.isCancelled()) {
return;
}
listener.onTimeout(this.timeout);
if (lifecycle.stoppedOrClosed()) {
listener.onClose();
} else {
listener.onTimeout(this.timeout);
}
// note, we rely on the listener to remove itself in case of timeout if needed
}
}