From b5e7bff927eea9c67b38db49ea3242ded4b3ea52 Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Mon, 18 Mar 2013 11:48:55 -0700 Subject: [PATCH] TaskMasterLifecycle: Less noisy exit when interrupted --- .../druid/merger/coordinator/TaskMasterLifecycle.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(); } }