last round of fixes, see #2376

This commit is contained in:
Roland 2012-08-17 14:27:56 +02:00
parent 85dcfd87d1
commit a98cdffae5
3 changed files with 6 additions and 7 deletions

View file

@ -227,7 +227,6 @@ class ActorSystemSpec extends AkkaSpec("""akka.extensions = ["akka.actor.TestExt
}
}))
EventFilter[Exception]("hello") intercept {
Thread.sleep(250)
a ! "die"
awaitCond(system.isTerminated)
}

View file

@ -372,10 +372,10 @@ class LocalActorRefProvider(
}
}
private class Guardian(override val supervisorStrategy: SupervisorStrategy) extends Actor {
private class Guardian(override val supervisorStrategy: SupervisorStrategy, isSystem: Boolean) extends Actor {
def receive = {
case Terminated(_) if (context.self.path.name == "system") eventStream.stopDefaultLoggers(); context.stop(self)
case Terminated(_) if (isSystem) eventStream.stopDefaultLoggers(); context.stop(self)
case StopChild(child) context.stop(child)
case m deadLetters ! DeadLetter(m, sender, self)
}
@ -434,7 +434,7 @@ class LocalActorRefProvider(
protected def systemGuardianStrategy: SupervisorStrategy = SupervisorStrategy.defaultStrategy
lazy val rootGuardian: LocalActorRef =
new LocalActorRef(system, Props(new Guardian(rootGuardianStrategy)), theOneWhoWalksTheBubblesOfSpaceTime, rootPath) {
new LocalActorRef(system, Props(new Guardian(rootGuardianStrategy, isSystem = false)), theOneWhoWalksTheBubblesOfSpaceTime, rootPath) {
override def getParent: InternalActorRef = this
override def getSingleChild(name: String): InternalActorRef = name match {
case "temp" tempContainer
@ -444,12 +444,12 @@ class LocalActorRefProvider(
lazy val guardian: LocalActorRef = {
rootGuardian.underlying.reserveChild("user")
new LocalActorRef(system, Props(new Guardian(guardianStrategy)), rootGuardian, rootPath / "user")
new LocalActorRef(system, Props(new Guardian(guardianStrategy, isSystem = false)), rootGuardian, rootPath / "user")
}
lazy val systemGuardian: LocalActorRef = {
rootGuardian.underlying.reserveChild("system")
new LocalActorRef(system, Props(new Guardian(systemGuardianStrategy)), rootGuardian, rootPath / "system")
new LocalActorRef(system, Props(new Guardian(systemGuardianStrategy, isSystem = true)), rootGuardian, rootPath / "system")
}
lazy val tempContainer = new VirtualPathContainer(system.provider, tempNode, rootGuardian, log)

View file

@ -27,7 +27,7 @@ private[akka] case object ChildNameReserved extends ChildStats
case class ChildRestartStats(child: ActorRef, var maxNrOfRetriesCount: Int = 0, var restartTimeWindowStartNanos: Long = 0L)
extends ChildStats {
var uid = 0
var uid: Int = 0
//FIXME How about making ChildRestartStats immutable and then move these methods into the actual supervisor strategies?
def requestRestartPermission(retriesWindow: (Option[Int], Option[Int])): Boolean =