fix some bugs, but probably not the pesky ones

- enqueuing system messages to DeadLetterMailbox was broken in
  principle, but not in practice for the current default deadLetter
  implementation
- add assert that system messages are not enqueued multiple times
- *BusSpec was using incorrect compareSubscribers based on
  identityHashCode, so moved the proper solution out of
  BalancingDispatcher and into akka.util.Helpers and reuse that in all
  places
This commit is contained in:
Roland 2011-11-11 17:44:57 +01:00
parent 9a10953219
commit 3808853845
5 changed files with 25 additions and 16 deletions

View file

@ -244,6 +244,7 @@ trait DefaultSystemMessageQueue { self: Mailbox ⇒
@tailrec
final def systemEnqueue(message: SystemMessage): Unit = {
assert(message.next eq null)
if (Mailbox.debug) println(actor + " having enqueued " + message)
val head = systemQueueGet
/*
@ -253,7 +254,10 @@ trait DefaultSystemMessageQueue { self: Mailbox ⇒
* Hence, SystemMessage.next does not need to be volatile.
*/
message.next = head
if (!systemQueuePut(head, message)) systemEnqueue(message)
if (!systemQueuePut(head, message)) {
message.next = null
systemEnqueue(message)
}
}
@tailrec