feature(worker): catch errors from runProcessLoop and shutdown

This commit is contained in:
bencvdb 2019-06-26 13:51:50 -07:00
parent 9e102af3dd
commit d2f95cb5ed

View file

@ -489,13 +489,16 @@ public class Worker implements Runnable {
shutdown(); shutdown();
} }
try {
while (!shouldShutdown()) { while (!shouldShutdown()) {
runProcessLoop(); runProcessLoop();
} }
}
finally {
finalShutdown(); finalShutdown();
LOG.info("Worker loop is complete. Exiting from worker."); LOG.info("Worker loop is complete. Exiting from worker.");
} }
}
@VisibleForTesting @VisibleForTesting
void runProcessLoop() { void runProcessLoop() {