nemo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-nemo] taegeonum commented on a change in pull request #187: [NEMO-324] Distinguish Beam's run and waitUntilFinish methods
Date Thu, 14 Mar 2019 03:36:05 GMT
taegeonum commented on a change in pull request #187: [NEMO-324] Distinguish Beam's run and
waitUntilFinish methods
URL: https://github.com/apache/incubator-nemo/pull/187#discussion_r265409522
 
 

 ##########
 File path: client/src/main/java/org/apache/nemo/client/beam/NemoPipelineResult.java
 ##########
 @@ -49,10 +64,19 @@ public State cancel() throws IOException {
 
   @Override
   public State waitUntilFinish(final Duration duration) {
-    throw new UnsupportedOperationException();
-    // TODO #208: NemoPipelineResult#waitUntilFinish hangs
-    // Previous code that hangs the job:
-    // return (State) super.waitUntilJobFinish(duration.getMillis(), TimeUnit.MILLISECONDS);
+    final boolean finished;
+    try {
+      finished = this.jobDone.await(duration.getMillis(), TimeUnit.MILLISECONDS);
+    } catch (final InterruptedException e) {
+      throw new RuntimeException(e);
+    }
+    if (finished) {
+      LOG.info("Job successfully finished before timeout of {}ms, while waiting until finish",
duration);
+    } else {
+      LOG.info("Job timed out before {}ms, while waiting until finish.", duration);
+      JobLauncher.shutdown();
+    }
+    return (State) super.waitUntilJobFinish(duration.getMillis(), TimeUnit.MILLISECONDS);
 
 Review comment:
   We've already waited the duration at line 69. Why do we wait again here?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message