another round of fixes due to suspend counting, see #2212

- always suspend/resume for Suspend/Resume/Recreate, no matter which
  state the actor is in, to keep the counter balanced
- preRestart failures are logged but otherwise ignored; there’s nothing
  else (apart from terminating the actor) which we could do at that
  point
- preRestart/postRestart exceptions have their own distinguishable
  subtype of ActorKilledException now
- fix some race conditions in tests to make them produce fewer false
  failures
- remove cruft from SupervisorStrategy and add methods which can
  actually be used to implement your own (with proper warning signs)
This commit is contained in:
Roland 2012-07-04 09:20:17 +02:00
parent 1148e20dbb
commit 78a39198f1
15 changed files with 243 additions and 137 deletions

View file

@ -151,7 +151,7 @@ class CallingThreadDispatcher(
override def suspend(actor: ActorCell) {
actor.mailbox match {
case m: CallingThreadMailbox m.suspendSwitch.switchOn
case m: CallingThreadMailbox m.suspendSwitch.switchOn; m.becomeSuspended()
case m m.systemEnqueue(actor.self, Suspend())
}
}
@ -163,11 +163,12 @@ class CallingThreadDispatcher(
val wasActive = queue.isActive
val switched = mbox.suspendSwitch.switchOff {
CallingThreadDispatcherQueues(actor.system).gatherFromAllOtherQueues(mbox, queue)
mbox.becomeOpen()
}
if (switched && !wasActive) {
runQueue(mbox, queue)
}
case m m.systemEnqueue(actor.self, Resume())
case m m.systemEnqueue(actor.self, Resume(false))
}
}