From de4fc981284af23323278813aa0db163f6097799 Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Thu, 14 Feb 2013 13:36:43 -0800 Subject: [PATCH] TaskMasterLifecycle: Stop leaderLifecycle if it dies while starting --- .../metamx/druid/merger/coordinator/TaskMasterLifecycle.java | 3 ++- 1 file changed, 2 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 7257e3fa679..49cd69fbd01 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 @@ -94,11 +94,12 @@ public class TaskMasterLifecycle leaderLifecycle.addManagedInstance(taskRunner); Initialization.makeServiceDiscoveryClient(curator, serviceDiscoveryConfig, leaderLifecycle); leaderLifecycle.addManagedInstance(taskConsumer); - leaderLifecycle.start(); leading = true; try { + leaderLifecycle.start(); + while (leading) { mayBeStopped.await(); }