Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,26 @@ public void start(String name) {
LOG.info("Starting {} workers[{}] with queue size {}...",
this.workers, name, this.queueSize);
for (int i = 0; i < this.workers; i++) {
this.runningFutures.add(
this.executor.submit(new ContextCallable<>(this::runAndDone)));
this.runningFutures.add(this.executor.submit(this::safeRun));
}

}
private Void safeRun() {
Comment thread
bitflicker64 marked this conversation as resolved.
Outdated
try {
new ContextCallable<>(this::runAndDone).call();
Comment thread
bitflicker64 marked this conversation as resolved.
Outdated
} catch (Throwable e) {
Comment thread
bitflicker64 marked this conversation as resolved.
Outdated
LOG.error("Worker failed before runAndDone()", e);
Comment thread
bitflicker64 marked this conversation as resolved.
Outdated
if (this.exception == null) {
this.exception = e;
}
exceptionHandle(e);
Comment thread
bitflicker64 marked this conversation as resolved.
Outdated
} finally {
this.latch.countDown();
}
return null;
}


private Void runAndDone() {
try {
this.run();
Expand All @@ -124,7 +139,6 @@ private Void runAndDone() {
exceptionHandle(e);
} finally {
this.done();
this.latch.countDown();
}
return null;
}
Expand Down
Loading