TaskMasterLifecycle: Less noisy exit when interrupted

This commit is contained in:
Gian Merlino 2013-03-18 11:48:55 -07:00
parent 5f513be363
commit b5e7bff927
1 changed files with 5 additions and 1 deletions

View File

@ -109,12 +109,16 @@ public class TaskMasterLifecycle
try { try {
leaderLifecycle.start(); leaderLifecycle.start();
while (leading) { while (leading && !Thread.currentThread().isInterrupted()) {
mayBeStopped.await(); mayBeStopped.await();
} }
} }
catch (InterruptedException e) {
// Suppress so we can bow out gracefully
}
finally { finally {
log.info("Bowing out!"); log.info("Bowing out!");
stopLeading();
leaderLifecycle.stop(); leaderLifecycle.stop();
} }
} }