Ensure proper cleanup even if postStop throws an exception.
This commit is contained in:
parent
2aa8cb161b
commit
20ccd0230e
1 changed files with 11 additions and 8 deletions
|
|
@ -656,15 +656,18 @@ class LocalActorRef private[akka] (
|
|||
cancelReceiveTimeout
|
||||
dispatcher.detach(this)
|
||||
_status = ActorRefInternals.SHUTDOWN
|
||||
actor.postStop
|
||||
currentMessage = null
|
||||
Actor.registry.unregister(this)
|
||||
if (isRemotingEnabled) {
|
||||
if (isClientManaged_?)
|
||||
Actor.remote.unregisterClientManagedActor(homeAddress.get.getHostName, homeAddress.get.getPort, uuid)
|
||||
Actor.remote.unregister(this)
|
||||
try {
|
||||
actor.postStop
|
||||
} finally {
|
||||
currentMessage = null
|
||||
Actor.registry.unregister(this)
|
||||
if (isRemotingEnabled) {
|
||||
if (isClientManaged_?)
|
||||
Actor.remote.unregisterClientManagedActor(homeAddress.get.getHostName, homeAddress.get.getPort, uuid)
|
||||
Actor.remote.unregister(this)
|
||||
}
|
||||
setActorSelfFields(actorInstance.get,null)
|
||||
}
|
||||
setActorSelfFields(actorInstance.get,null)
|
||||
} //else if (isBeingRestarted) throw new ActorKilledException("Actor [" + toString + "] is being restarted.")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue