Add named exception to detect when a cluster node has been quarantined by others #18758

Publish appropriate events to the current ActorSystem event stream upon remote ActorSystem shutdown or when current ActorSystem is quarantined by the remote ActorSystem.
This commit is contained in:
Eugene Dzhurinsky 2015-12-06 20:14:44 -05:00
parent 9d71142748
commit fb763040f2
7 changed files with 38 additions and 5 deletions

View file

@ -441,7 +441,7 @@ private[remote] class EndpointManager(conf: Config, log: LoggingAdapter) extends
override val supervisorStrategy =
OneForOneStrategy(loggingEnabled = false) {
case e @ InvalidAssociation(localAddress, remoteAddress, reason)
case e @ InvalidAssociation(localAddress, remoteAddress, reason, disassiciationInfo)
keepQuarantinedOr(remoteAddress) {
val causedBy = if (reason.getCause == null) "" else s"Caused by: [${reason.getCause.getMessage}]"
log.warning("Tried to associate with unreachable remote address [{}]. " +
@ -450,6 +450,11 @@ private[remote] class EndpointManager(conf: Config, log: LoggingAdapter) extends
remoteAddress, settings.RetryGateClosedFor.toMillis, reason.getMessage, causedBy)
endpoints.markAsFailed(sender(), Deadline.now + settings.RetryGateClosedFor)
}
disassiciationInfo.foreach {
case AssociationHandle.Quarantined
context.system.eventStream.publish(ThisActorSystemQuarantinedEvent(localAddress, remoteAddress))
case _ // do nothing
}
Stop
case ShutDownAssociation(localAddress, remoteAddress, _)