diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskMasterLifecycle.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskMasterLifecycle.java index d8e934b036e..e1b9396a346 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskMasterLifecycle.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskMasterLifecycle.java @@ -109,12 +109,16 @@ public class TaskMasterLifecycle try { leaderLifecycle.start(); - while (leading) { + while (leading && !Thread.currentThread().isInterrupted()) { mayBeStopped.await(); } } + catch (InterruptedException e) { + // Suppress so we can bow out gracefully + } finally { log.info("Bowing out!"); + stopLeading(); leaderLifecycle.stop(); } }