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;
|
boolean isDone = false;
|
||||||
Exception lastException = null;
|
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 {
|
try {
|
||||||
LOG.info("Initialization attempt " + (i + 1));
|
LOG.info("Initialization attempt " + (i + 1));
|
||||||
LOG.info("Initializing LeaseCoordinator");
|
LOG.info("Initializing LeaseCoordinator");
|
||||||
|
|
@ -413,7 +413,7 @@ public class Worker implements Runnable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isDone) {
|
if (!isDone && (lastException != null)) {
|
||||||
throw new RuntimeException(lastException);
|
throw new RuntimeException(lastException);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue