private void shutdownChild(ChildEntry child, boolean beforeRestart) throws SuspendExecution, InterruptedException {
if (child.actor != null) {
unwatch(child);
if (!isLocal(child.actor) || !LocalActor.isDone(child.actor)) {
log().info("{} shutting down child {}", this, child.actor);
ActorUtil.sendOrInterrupt(child.actor, new ShutdownMessage(this.ref()));
}
if (isLocal(child.actor)) {
try {
joinChild(child);