Added try-finally blocks for each shutdown step in the Gossipper.shutdown method.
Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
This commit is contained in:
parent
0b59640820
commit
7dbb5e9abb
1 changed files with 10 additions and 5 deletions
|
|
@ -174,11 +174,16 @@ case class Gossiper(remote: RemoteActorRefProvider, system: ActorSystemImpl) {
|
|||
*/
|
||||
def shutdown() {
|
||||
if (isRunning.compareAndSet(true, false)) {
|
||||
log.info("Shutting down Gossiper for [{}]", address)
|
||||
connectionManager.shutdown()
|
||||
system.stop(clusterDaemon)
|
||||
initateGossipCanceller.cancel()
|
||||
scrutinizeCanceller.cancel()
|
||||
log.info("Shutting down Gossiper for [{}]...", address)
|
||||
try connectionManager.shutdown() finally {
|
||||
try system.stop(clusterDaemon) finally {
|
||||
try initateGossipCanceller.cancel() finally {
|
||||
try scrutinizeCanceller.cancel() finally {
|
||||
log.info("Gossiper for [{}] is shut down", address)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue