AndyJiang99 commented on code in PR #3862:
URL: https://github.com/apache/gobblin/pull/3862#discussion_r1456712626
##########
gobblin-utility/src/main/java/org/apache/gobblin/util/LoggingUncaughtExceptionHandler.java:
##########
@@ -42,6 +45,7 @@ public LoggingUncaughtExceptionHandler(Optional<Logger>
logger) {
@Override
public void uncaughtException(Thread t, Throwable e) {
+ exception = e;
Review Comment:
The exception variable is set but never used, maybe missing something?
##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/StreamModelTaskRunner.java:
##########
@@ -155,13 +156,17 @@ protected void run() throws Exception {
Thread thread = new Thread(() -> connectableStream.connect());
thread.setName(this.getClass().getSimpleName());
//Log uncaught exceptions (e.g.OOMEs) to prevent threads from dying
silently
- thread.setUncaughtExceptionHandler(new
LoggingUncaughtExceptionHandler(Optional.absent()));
+ LoggingUncaughtExceptionHandler exceptionHandler = new
LoggingUncaughtExceptionHandler(Optional.absent());
+ thread.setUncaughtExceptionHandler(exceptionHandler);
thread.start();
-
- if (!ExponentialBackoff.awaitCondition().callable(() ->
this.forks.keySet().stream().map(Optional::get).allMatch(Fork::isDone)).
+ if (!ExponentialBackoff.awaitCondition().callable(() ->
+ this.forks.keySet().stream().map(Optional::get).allMatch(Fork::isDone)
|| exceptionHandler.getException() != null).
initialDelay(initialDelay).maxDelay(initialDelay).maxWait(TimeUnit.MINUTES.toMillis(maxWaitInMinute)).await())
{
throw new TimeoutException("Forks did not finish withing specified
timeout.");
}
+ if (exceptionHandler.getException() != null) {
+ throw Throwables.propagate(exceptionHandler.getException());
+ }
Review Comment:
You mentioned a mock to test this functionality to fail the container and
retry the job again, but I don't see the rests associated with that
--
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]