From 21cd75bcf6d56c71e77900650bb3a7bea1a56294 Mon Sep 17 00:00:00 2001 From: nishantmonu51 Date: Wed, 18 Mar 2015 09:42:22 +0530 Subject: [PATCH] improve alert skip doing false alert when the coordinator looses leadership --- .../java/io/druid/server/coordinator/LoadQueuePeon.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/io/druid/server/coordinator/LoadQueuePeon.java b/server/src/main/java/io/druid/server/coordinator/LoadQueuePeon.java index e0ba329a8fe..d2f9d11256d 100644 --- a/server/src/main/java/io/druid/server/coordinator/LoadQueuePeon.java +++ b/server/src/main/java/io/druid/server/coordinator/LoadQueuePeon.java @@ -86,6 +86,7 @@ public class LoadQueuePeon private final Object lock = new Object(); private volatile SegmentHolder currentlyProcessing = null; + private boolean stopped = false; LoadQueuePeon( CuratorFramework curator, @@ -209,9 +210,12 @@ public class LoadQueuePeon { synchronized (lock) { try { + // expected when the coordinator looses leadership and LoadQueuePeon is stopped. if (currentlyProcessing == null) { - log.makeAlert("Crazy race condition! server[%s]", basePath) - .emit(); + if(!stopped) { + log.makeAlert("Crazy race condition! server[%s]", basePath) + .emit(); + } actionCompleted(); doNext(); return; @@ -347,6 +351,7 @@ public class LoadQueuePeon queuedSize.set(0L); failedAssignCount.set(0); + stopped = true; } }