From: Tom Pantelis Date: Fri, 12 Feb 2016 14:56:46 +0000 (-0500) Subject: Reduce output from DeadlockMonitor X-Git-Tag: release/boron~378 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=384479f0181763f3202f2f7ad681e90182bcc820;hp=40173010bbe30f908688c3a4e0818c26c8cd4ded Reduce output from DeadlockMonitor If a module doesn't finish after 5 sec, the DeadlockMonitor starts logging warning messages. However it does this every second. CDS will wait up to 90 sec for all shards to elect a leader so the DeadlockMonitor produces a lot of output during this period. To reduce the noise I changed the sleep to use WARN_AFTER_MILLIS so the message is logged every 5 sec. Change-Id: I63842075dee1fc6a4fc4e4200cc089e33a110e78 Signed-off-by: Tom Pantelis --- diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java index e3fbcd0edb..9882b4662c 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java @@ -77,7 +77,11 @@ public class DeadlockMonitor implements AutoCloseable { public void run() { ModuleIdentifierWithNanos old = new ModuleIdentifierWithNanos(); // null moduleId while (this.isInterrupted() == false) { - ModuleIdentifierWithNanos copy = new ModuleIdentifierWithNanos(DeadlockMonitor.this.top); + ModuleIdentifierWithNanos copy; + synchronized(this) { + copy = new ModuleIdentifierWithNanos(DeadlockMonitor.this.top); + } + if (old.moduleIdentifier == null || old.equals(copy) == false) { // started old = copy; @@ -89,7 +93,7 @@ public class DeadlockMonitor implements AutoCloseable { } } try { - sleep(1000); + sleep(WARN_AFTER_MILLIS); } catch (InterruptedException e) { interrupt(); }