React to shutdown signal during initializing attempts
This commit is contained in:
parent
9b1549e810
commit
2b244a67b5
1 changed files with 2 additions and 2 deletions
|
|
@ -373,7 +373,7 @@ public class Worker implements Runnable {
|
|||
boolean isDone = false;
|
||||
Exception lastException = null;
|
||||
|
||||
for (int i = 0; (!isDone) && (i < MAX_INITIALIZATION_ATTEMPTS); i++) {
|
||||
for (int i = 0; (!isDone) && (i < MAX_INITIALIZATION_ATTEMPTS) && (!shutdown); i++) {
|
||||
try {
|
||||
LOG.info("Initialization attempt " + (i + 1));
|
||||
LOG.info("Initializing LeaseCoordinator");
|
||||
|
|
@ -413,7 +413,7 @@ public class Worker implements Runnable {
|
|||
}
|
||||
}
|
||||
|
||||
if (!isDone) {
|
||||
if (!isDone && (lastException != null)) {
|
||||
throw new RuntimeException(lastException);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue