tillrohrmann commented on a change in pull request #18610:
URL: https://github.com/apache/flink/pull/18610#discussion_r812696942
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/source/coordinator/SourceCoordinatorContext.java
##########
@@ -257,9 +260,19 @@ public void signalNoMoreSplits(int subtask) {
notifier.notifyReadyAsync(callable, handler);
}
+ /** {@inheritDoc} If the runnable throws an Exception, the corresponding
job is failed. */
@Override
public void runInCoordinatorThread(Runnable runnable) {
- coordinatorExecutor.execute(runnable);
+ final Future<?> future = coordinatorExecutor.submit(runnable);
+ try {
+ future.get(RUN_IN_COORDINATOR_THREAD_TIMEOUT, TimeUnit.SECONDS);
+ } catch (Exception e) {
+ LOG.error(
+ "Job failed: Thread '{}' produced an uncaught exception.
Stopping the job...",
+ coordinatorThreadName,
+ e);
+ operatorCoordinatorContext.failJob(e);
+ }
Review comment:
I think we cannot do it like this because it will block the caller (main
thread). I think we need to do something similar to
https://stackoverflow.com/questions/12175985/how-to-make-scheduledthreadpool-report-errors
where we wrap the runnable to catch the exception.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]