From a949f1672dcc171c4e4e0d84369b3b8b6ee49543 Mon Sep 17 00:00:00 2001 From: cheddar Date: Fri, 7 Jun 2013 14:14:58 -0700 Subject: [PATCH] 1) Fix bug with Master stopping trying to be Master after he losses it once --- .../main/java/com/metamx/druid/master/DruidMaster.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/metamx/druid/master/DruidMaster.java b/server/src/main/java/com/metamx/druid/master/DruidMaster.java index c3800e87bba..13fe5a58c1e 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMaster.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMaster.java @@ -57,6 +57,7 @@ import org.joda.time.DateTime; import org.joda.time.Duration; import javax.annotation.Nullable; +import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -473,6 +474,13 @@ public class DruidMaster stopBeingMaster(); + try { + leaderLatch.get().close(); + } + catch (IOException e) { + log.warn(e, "Unable to close leaderLatch, ignoring"); + } + started = false; exec.shutdownNow(); @@ -558,8 +566,6 @@ public class DruidMaster try { log.info("I am no longer the master..."); - leaderLatch.get().close(); - for (String server : loadManagementPeons.keySet()) { LoadQueuePeon peon = loadManagementPeons.remove(server); peon.stop();