last round of fixes, see #2376
This commit is contained in:
parent
85dcfd87d1
commit
a98cdffae5
3 changed files with 6 additions and 7 deletions
|
|
@ -227,7 +227,6 @@ class ActorSystemSpec extends AkkaSpec("""akka.extensions = ["akka.actor.TestExt
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
EventFilter[Exception]("hello") intercept {
|
EventFilter[Exception]("hello") intercept {
|
||||||
Thread.sleep(250)
|
|
||||||
a ! "die"
|
a ! "die"
|
||||||
awaitCond(system.isTerminated)
|
awaitCond(system.isTerminated)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 = {
|
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 StopChild(child) ⇒ context.stop(child)
|
||||||
case m ⇒ deadLetters ! DeadLetter(m, sender, self)
|
case m ⇒ deadLetters ! DeadLetter(m, sender, self)
|
||||||
}
|
}
|
||||||
|
|
@ -434,7 +434,7 @@ class LocalActorRefProvider(
|
||||||
protected def systemGuardianStrategy: SupervisorStrategy = SupervisorStrategy.defaultStrategy
|
protected def systemGuardianStrategy: SupervisorStrategy = SupervisorStrategy.defaultStrategy
|
||||||
|
|
||||||
lazy val rootGuardian: LocalActorRef =
|
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 getParent: InternalActorRef = this
|
||||||
override def getSingleChild(name: String): InternalActorRef = name match {
|
override def getSingleChild(name: String): InternalActorRef = name match {
|
||||||
case "temp" ⇒ tempContainer
|
case "temp" ⇒ tempContainer
|
||||||
|
|
@ -444,12 +444,12 @@ class LocalActorRefProvider(
|
||||||
|
|
||||||
lazy val guardian: LocalActorRef = {
|
lazy val guardian: LocalActorRef = {
|
||||||
rootGuardian.underlying.reserveChild("user")
|
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 = {
|
lazy val systemGuardian: LocalActorRef = {
|
||||||
rootGuardian.underlying.reserveChild("system")
|
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)
|
lazy val tempContainer = new VirtualPathContainer(system.provider, tempNode, rootGuardian, log)
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ private[akka] case object ChildNameReserved extends ChildStats
|
||||||
case class ChildRestartStats(child: ActorRef, var maxNrOfRetriesCount: Int = 0, var restartTimeWindowStartNanos: Long = 0L)
|
case class ChildRestartStats(child: ActorRef, var maxNrOfRetriesCount: Int = 0, var restartTimeWindowStartNanos: Long = 0L)
|
||||||
extends ChildStats {
|
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?
|
//FIXME How about making ChildRestartStats immutable and then move these methods into the actual supervisor strategies?
|
||||||
def requestRestartPermission(retriesWindow: (Option[Int], Option[Int])): Boolean =
|
def requestRestartPermission(retriesWindow: (Option[Int], Option[Int])): Boolean =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue