add even more logging

This commit is contained in:
Roland 2012-09-04 10:57:13 +02:00
parent df46b3cf59
commit 7ece60d998
2 changed files with 11 additions and 2 deletions

View file

@ -192,7 +192,9 @@ object SupervisorHierarchySpec {
case x (x, x)
}
override val supervisorStrategy = OneForOneStrategy()(unwrap andThen {
case _ if pongsToGo > 0 Resume
case _: Failure if pongsToGo > 0
log :+= Event("pongOfDeath resuming " + sender)
Resume
case (f: Failure, orig)
if (f.depth > 0) {
setFlags(f.directive)
@ -225,6 +227,9 @@ object SupervisorHierarchySpec {
context.watch(context.actorOf(props, name))
}
}
if (context.children.size != state.kids.size) {
abort("invariant violated: " + state.kids.size + " != " + context.children.size)
}
cause match {
case f: Failure if f.failPost > 0 f.failPost -= 1; throw f
case PostRestartException(`self`, f: Failure, _) if f.failPost > 0 f.failPost -= 1; throw f
@ -279,11 +284,14 @@ object SupervisorHierarchySpec {
val kids = stateCache.get(self).kids(ref)
val props = Props(new Hierarchy(kids, breadth, listener, myLevel + 1)).withDispatcher("hierarchy")
context.watch(context.actorOf(props, name))
} else {
log :+= Event(sender + " terminated while pongOfDeath")
}
case Abort abort("terminating")
case PingOfDeath
if (size > 1) {
pongsToGo = context.children.size
log :+= Event("sending " + pongsToGo + " pingOfDeath")
context.children foreach (_ ! PingOfDeath)
} else {
context stop self
@ -570,6 +578,7 @@ object SupervisorHierarchySpec {
println(system.asInstanceOf[ActorSystemImpl].printTree)
getErrors(hierarchy, 10)
printErrors()
idleChildren foreach println
testActor ! "timeout in Stopping"
stop
case Event(e: ErrorLog, _)

View file

@ -31,7 +31,7 @@ object AkkaSpec {
fork-join-executor {
parallelism-min = 8
parallelism-factor = 2.0
parallelism-max = 8
parallelism-max = 18
}
}
}