From 2089fcf84c36364774339ea76b573e4f5e2bf9da Mon Sep 17 00:00:00 2001 From: Roland Date: Tue, 21 Aug 2012 14:45:13 +0200 Subject: [PATCH] fix NullMessage handling to not be logged as AutoReceiveMessage --- akka-actor/src/main/scala/akka/actor/ActorCell.scala | 3 +-- .../src/main/scala/akka/dispatch/AbstractDispatcher.scala | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/akka-actor/src/main/scala/akka/actor/ActorCell.scala b/akka-actor/src/main/scala/akka/actor/ActorCell.scala index a07e60ea45..c03faf46cf 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorCell.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorCell.scala @@ -359,12 +359,11 @@ private[akka] class ActorCell( checkReceiveTimeout // Reschedule receive timeout } - def autoReceiveMessage(msg: Envelope): Unit = { + def autoReceiveMessage(msg: Envelope): Unit = if (msg.message != NullMessage) { if (system.settings.DebugAutoReceive) publish(Debug(self.path.toString, clazz(actor), "received AutoReceiveMessage " + msg)) msg.message match { - case NullMessage ⇒ // do nothing case Failed(cause, uid) ⇒ handleFailure(sender, cause, uid) case t @ Terminated(actor) ⇒ getChildByRef(actor) match { diff --git a/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala index e3e210d964..f251ac4588 100644 --- a/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala @@ -41,10 +41,10 @@ object Envelope { * This message is sent directly after the Supervise system message in order * to form a barrier wrt. the first real message sent by the child, so that e.g. * Failed() cannot overtake Supervise(). Processing this does nothing. - * + * * Detailed explanation: - * - * The race happens because Supervise and Failed may be queued between the + * + * The race happens because Supervise and Failed may be queued between the * parent's check for system messages and dequeue(). Thus, if the parent * processes the NullMessage first (by way of that tiny race window), it is * guaranteed to then find the Supervise system message in its mailbox prior