diff --git a/akka-actor/src/main/scala/akka/actor/dungeon/DeathWatch.scala b/akka-actor/src/main/scala/akka/actor/dungeon/DeathWatch.scala index 017a880b1a..ebe92b23b1 100644 --- a/akka-actor/src/main/scala/akka/actor/dungeon/DeathWatch.scala +++ b/akka-actor/src/main/scala/akka/actor/dungeon/DeathWatch.scala @@ -78,9 +78,7 @@ private[akka] trait DeathWatch { this: ActorCell ⇒ if (!watching.isEmpty) { try { watching foreach { // ➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅ - case watchee: InternalActorRef ⇒ try watchee.sendSystemMessage(Unwatch(watchee, self)) catch { - case NonFatal(t) ⇒ publish(Error(t, self.path.toString, clazz(actor), "deathwatch")) - } + case watchee: InternalActorRef ⇒ watchee.sendSystemMessage(Unwatch(watchee, self)) } } finally { watching = ActorCell.emptyActorRefSet diff --git a/akka-remote/src/main/scala/akka/remote/Endpoint.scala b/akka-remote/src/main/scala/akka/remote/Endpoint.scala index 0b5cc1306d..89ffe0ac11 100644 --- a/akka-remote/src/main/scala/akka/remote/Endpoint.scala +++ b/akka-remote/src/main/scala/akka/remote/Endpoint.scala @@ -56,9 +56,7 @@ private[remote] class DefaultMessageDispatcher(private val system: ExtendedActor if (LogReceive) log.debug("received daemon message {}", msgLog) payload match { case m @ (_: DaemonMsg | _: Terminated) ⇒ - try remoteDaemon ! m catch { - case NonFatal(e) ⇒ log.error(e, "exception while processing remote command {} from {}", m, sender) - } + remoteDaemon ! m case x ⇒ log.debug("remoteDaemon received illegal message {} from {}", x, sender) } } diff --git a/akka-remote/src/main/scala/akka/remote/RemoteDaemon.scala b/akka-remote/src/main/scala/akka/remote/RemoteDaemon.scala index 850518b245..a6e8f762d9 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteDaemon.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteDaemon.scala @@ -5,6 +5,7 @@ package akka.remote import scala.annotation.tailrec +import scala.util.control.NonFatal import akka.actor.{ VirtualPathContainer, Terminated, Deploy, Props, Nobody, LocalActorRef, InternalActorRef, Address, ActorSystemImpl, ActorRef, ActorPathExtractor, ActorPath, Actor, AddressTerminated } import akka.event.LoggingAdapter import akka.dispatch.Watch @@ -62,11 +63,11 @@ private[akka] class RemoteSystemDaemon( } } - override def !(msg: Any)(implicit sender: ActorRef = Actor.noSender): Unit = msg match { + override def !(msg: Any)(implicit sender: ActorRef = Actor.noSender): Unit = try msg match { case message: DaemonMsg ⇒ log.debug("Received command [{}] to RemoteSystemDaemon on [{}]", message, path.address) message match { - case DaemonMsgCreate(_, _, path, _) if untrustedMode ⇒ log.debug("does not accept deployments (untrusted) for {}", path) + case DaemonMsgCreate(_, _, path, _) if untrustedMode ⇒ log.debug("does not accept deployments (untrusted) for [{}]", path) case DaemonMsgCreate(props, deploy, path, supervisor) ⇒ path match { case ActorPathExtractor(address, elems) if elems.nonEmpty && elems.head == "remote" ⇒ @@ -107,7 +108,10 @@ private[akka] class RemoteSystemDaemon( case _ ⇒ // skip, this child doesn't belong to the terminated address } - case unknown ⇒ log.warning("Unknown message {} received by {}", unknown, this) + case unknown ⇒ log.warning("Unknown message [{}] received by [{}]", unknown, this) + + } catch { + case NonFatal(e) ⇒ log.error(e, "exception while processing remote command [{}] from [{}]", msg, sender) } def terminationHookDoneWhenNoChildren(): Unit = terminating.whileOn {