Perform Terminate removeChild under the terminating lock also, see #2552
This commit is contained in:
parent
2b5eb67991
commit
2e343eca24
1 changed files with 8 additions and 5 deletions
|
|
@ -82,15 +82,17 @@ private[akka] class RemoteSystemDaemon(system: ActorSystemImpl, _path: ActorPath
|
|||
}
|
||||
|
||||
case Terminated(child: ActorRefWithCell) if child.asInstanceOf[ActorRefScope].isLocal ⇒
|
||||
removeChild(child.path.elements.drop(1).mkString("/"))
|
||||
terminationHookDoneWhenNoChildren()
|
||||
terminating.locked {
|
||||
removeChild(child.path.elements.drop(1).mkString("/"))
|
||||
terminationHookDoneWhenNoChildren()
|
||||
}
|
||||
|
||||
case t: Terminated ⇒
|
||||
|
||||
case TerminationHook ⇒
|
||||
terminating.switchOn {
|
||||
terminationHookDoneWhenNoChildren()
|
||||
foreachChild { system.stop(_) }
|
||||
foreachChild { system.stop }
|
||||
}
|
||||
|
||||
case AddressTerminated(address) ⇒
|
||||
|
|
@ -99,7 +101,8 @@ private[akka] class RemoteSystemDaemon(system: ActorSystemImpl, _path: ActorPath
|
|||
case unknown ⇒ log.warning("Unknown message {} received by {}", unknown, this)
|
||||
}
|
||||
|
||||
def terminationHookDoneWhenNoChildren(): Unit = if (terminating.isOn && !hasChildren)
|
||||
system.provider.systemGuardian.tell(TerminationHookDone, this)
|
||||
def terminationHookDoneWhenNoChildren(): Unit = terminating.whileOn {
|
||||
if (!hasChildren) system.provider.systemGuardian.tell(TerminationHookDone, this)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue