iPalash commented on code in PR #4096:
URL: https://github.com/apache/gobblin/pull/4096#discussion_r1946352560
##########
gobblin-yarn/src/main/java/org/apache/gobblin/yarn/GobblinYarnAppLauncher.java:
##########
@@ -380,6 +382,19 @@ public void launch() throws IOException, YarnException,
InterruptedException {
}, 0, this.appReportIntervalMinutes, TimeUnit.MINUTES);
addServices();
+
+ synchronized (this.applicationDone) {
+ while (!this.applicationCompleted) {
+ try {
+ this.applicationDone.wait();
+ if (this.applicationFailed) {
+ throw new RuntimeException("Gobblin Yarn application failed");
+ }
+ } catch (InterruptedException ie) {
+ LOGGER.error("Interrupted while waiting for the Gobblin Yarn
application to finish", ie);
+ }
+ }
+ }
Review Comment:
We register a shutdown hook via `Runtime.getRuntime().addShutdownHook`
From the documentation:
`Uncaught exceptions are handled in shutdown hooks just as in any other
thread`
--
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]