TaskMasterLifecycle: Stop leaderLifecycle if it dies while starting

This commit is contained in:
Gian Merlino 2013-02-14 13:36:43 -08:00
parent 18daa19fc9
commit de4fc98128
1 changed files with 2 additions and 1 deletions

View File

@ -94,11 +94,12 @@ public class TaskMasterLifecycle
leaderLifecycle.addManagedInstance(taskRunner); leaderLifecycle.addManagedInstance(taskRunner);
Initialization.makeServiceDiscoveryClient(curator, serviceDiscoveryConfig, leaderLifecycle); Initialization.makeServiceDiscoveryClient(curator, serviceDiscoveryConfig, leaderLifecycle);
leaderLifecycle.addManagedInstance(taskConsumer); leaderLifecycle.addManagedInstance(taskConsumer);
leaderLifecycle.start();
leading = true; leading = true;
try { try {
leaderLifecycle.start();
while (leading) { while (leading) {
mayBeStopped.await(); mayBeStopped.await();
} }