Unborkening the top-level surveillance

This commit is contained in:
Viktor Klang 2012-05-30 14:26:09 +02:00
parent f4a3bdff33
commit 6c1ca7fcdb
2 changed files with 11 additions and 17 deletions

View file

@ -462,7 +462,7 @@ private[akka] class ActorCell(
override final def watch(subject: ActorRef): ActorRef = subject match {
case a: InternalActorRef
if (!watching.contains(a)) {
if (a != self && !watching.contains(a)) {
a.sendSystemMessage(Watch(a, self)) // ➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅
watching += a
}
@ -471,7 +471,7 @@ private[akka] class ActorCell(
override final def unwatch(subject: ActorRef): ActorRef = subject match {
case a: InternalActorRef
if (watching.contains(a)) {
if (a != self && watching.contains(a)) {
a.sendSystemMessage(Unwatch(a, self)) // ➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅
watching -= a
}
@ -582,7 +582,7 @@ private[akka] class ActorCell(
}
} else if (!watcheeSelf && watcherSelf) {
watch(watchee)
} else println("addNOOOOOOOOO: " + watchee + " => " + watcher)
}
}
def remWatcher(watchee: ActorRef, watcher: ActorRef): Unit = {
@ -596,7 +596,7 @@ private[akka] class ActorCell(
}
} else if (!watcheeSelf && watcherSelf) {
unwatch(watchee)
} else println("remNOOOOOOOOO: " + watchee + " => " + watcher)
}
}
def terminate() {

View file

@ -474,18 +474,10 @@ class LocalActorRefProvider(
lazy val rootGuardian: InternalActorRef =
new LocalActorRef(system, guardianProps, theOneWhoWalksTheBubblesOfSpaceTime, rootPath, true) {
object Extra {
def unapply(s: String): Option[InternalActorRef] = extraNames.get(s)
}
override def getParent: InternalActorRef = this
override def getSingleChild(name: String): InternalActorRef = {
name match {
case "temp" tempContainer
case Extra(e) e
case _ super.getSingleChild(name)
}
override def getSingleChild(name: String): InternalActorRef = name match {
case "temp" tempContainer
case other extraNames.get(other).getOrElse(super.getSingleChild(other))
}
}
@ -510,8 +502,10 @@ class LocalActorRefProvider(
def init(_system: ActorSystemImpl) {
system = _system
// chain death watchers so that killing guardian stops the application
guardian.sendSystemMessage(Watch(systemGuardian, guardian))
rootGuardian.sendSystemMessage(Watch(rootGuardian, systemGuardian))
//guardian.sendSystemMessage(Watch(systemGuardian, guardian))
//rootGuardian.sendSystemMessage(Watch(rootGuardian, systemGuardian))
guardian.sendSystemMessage(Watch(guardian, systemGuardian))
rootGuardian.sendSystemMessage(Watch(systemGuardian, rootGuardian))
eventStream.startDefaultLoggers(_system)
}