diff --git a/akka-actor/src/main/scala/akka/actor/ActorCell.scala b/akka-actor/src/main/scala/akka/actor/ActorCell.scala index 1d46a48623..30f82e975f 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorCell.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorCell.scala @@ -443,8 +443,6 @@ private[akka] class ActorCell( app.eventHandler.error(e, self, "error while processing " + envelope.message) //TODO FIXME How should problems here be handled? throw e - } finally { - mailbox.acknowledgeStatus() //Volatile write } } @@ -487,8 +485,6 @@ private[akka] class ActorCell( messageHandle.channel sendException new ActorKilledException("Actor has been stopped") // throwing away message if actor is shut down, no use throwing an exception in receiving actor's thread, isShutdown is enforced on caller side } - } finally { - mailbox.acknowledgeStatus() } } diff --git a/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala b/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala index 89f5c9bb62..5e21d5ea87 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala @@ -128,7 +128,10 @@ abstract class Mailbox extends AbstractMailbox with MessageQueue with SystemMess */ if (s >= Scheduled) { updateStatus(s, s & ~Scheduled) || setAsIdle() - } else false + } else { + acknowledgeStatus() // this write is needed to make memory consistent after processMailbox() + false + } } def shouldBeRegisteredForExecution(hasMessageHint: Boolean, hasSystemMessageHint: Boolean): Boolean = status match {