From: Tom Pantelis Date: Sat, 25 Jun 2016 02:04:02 +0000 (-0400) Subject: Bug 6106: Prevent flood of quarantine messages X-Git-Tag: release/boron~90 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=c27b1c6a1a777b36269444ee5cda363850d2e6b5 Bug 6106: Prevent flood of quarantine messages Added a "quarantined" flag to the QuarantinedMonitorActor so it only prints the warning and attempts to restart the karaf container once (which is invoked indirectly via the caller's Effect callback). Change-Id: I0a57af729280abded93d1b1a575df1672e52032e Signed-off-by: Tom Pantelis (cherry picked from commit 3066f54d6d2c6206fa5fabc69a795993c68d2d77) --- diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/QuarantinedMonitorActor.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/QuarantinedMonitorActor.java index 8e2693e900..a9f58898d4 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/QuarantinedMonitorActor.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/QuarantinedMonitorActor.java @@ -33,6 +33,7 @@ public class QuarantinedMonitorActor extends UntypedActor { public static final String ADDRESS = "quarantined-monitor"; private final Effect callback; + private boolean quarantined; protected QuarantinedMonitorActor(Effect callback) { this.callback = callback; @@ -54,6 +55,10 @@ public class QuarantinedMonitorActor extends UntypedActor { // check to see if we got quarantined by another node + if(quarantined) { + return; + } + // TODO: follow https://github.com/akka/akka/issues/18758 to see if Akka adds a named // exception for quarantine detection if (message instanceof AssociationErrorEvent) { @@ -62,6 +67,8 @@ public class QuarantinedMonitorActor extends UntypedActor { if (cause instanceof InvalidAssociation) { Throwable cause2 = ((InvalidAssociation) cause).getCause(); if (cause2.getMessage().contains("quarantined this system")) { + quarantined = true; + LOG.warn("Got quarantined by {}", event.getRemoteAddress()); // execute the callback