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:
parent
9d71142748
commit
fb763040f2
7 changed files with 38 additions and 5 deletions
|
|
@ -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, _) ⇒
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue