From 384479f0181763f3202f2f7ad681e90182bcc820 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Fri, 12 Feb 2016 09:56:46 -0500 Subject: [PATCH 1/1] 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 --- .../controller/config/manager/impl/DeadlockMonitor.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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(); } -- 2.36.6