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 <tpanteli@brocade.com>
public void run() {
ModuleIdentifierWithNanos old = new ModuleIdentifierWithNanos(); // null moduleId
while (this.isInterrupted() == false) {
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;
if (old.moduleIdentifier == null || old.equals(copy) == false) {
// started
old = copy;
+ sleep(WARN_AFTER_MILLIS);
} catch (InterruptedException e) {
interrupt();
}
} catch (InterruptedException e) {
interrupt();
}