Make cluster fault handling more robust, see #3030

* ClusterCoreDaemon and ClusterDomainEventPublisher can't be restarted
  because the state would be obsolete.
* Add extra supervisor level for ClusterCoreDaemon and
  ClusterDomainEventPublisher, which will shutdown the member
  on failure in children.
* Publish the final removed state on postStop in
  ClusterDomainEventPublisher. This also simplifies the removing
  process.
This commit is contained in:
Patrik Nordwall 2013-02-11 10:40:01 +01:00
parent b002bda23f
commit cab78e5174
6 changed files with 86 additions and 32 deletions

View file

@ -91,5 +91,15 @@ class ClusterSpec extends AkkaSpec(ClusterSpec.config) with ImplicitSender {
expectMsgClass(classOf[ClusterEvent.CurrentClusterState])
}
// this must be the last test step, since the cluster is shutdown
"publish MemberRemoved when shutdown" in {
cluster.subscribe(testActor, classOf[ClusterEvent.MemberRemoved])
// first, is in response to the subscription
expectMsgClass(classOf[ClusterEvent.CurrentClusterState])
cluster.shutdown()
expectMsgType[ClusterEvent.MemberRemoved].member.address must be(selfAddress)
}
}
}