sv2000 commented on a change in pull request #2907: [GOBBLIN-1068]Clean up 
cyclic logic in task cancellation
URL: https://github.com/apache/incubator-gobblin/pull/2907#discussion_r404236184
 
 

 ##########
 File path: 
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/GobblinMultiTaskAttempt.java
 ##########
 @@ -152,13 +155,15 @@ public void run()
     }
 
     CountUpAndDownLatch countDownLatch = new CountUpAndDownLatch(0);
-    this.tasks = runWorkUnits(countDownLatch);
+    Pair<List<Task>, List<Future<?>>> taskExecutionResult = 
runWorkUnits(countDownLatch);
+    this.tasks = taskExecutionResult.getLeft();
+    this.taskFutures = taskExecutionResult.getRight();
     log.info("Waiting for submitted tasks of job {} to complete in container 
{}...", jobId, containerIdOptional.or(""));
     try {
       while (countDownLatch.getCount() > 0) {
         if (this.interruptionPredicate.test(this)) {
           log.info("Interrupting task execution due to satisfied predicate.");
-          interruptTaskExecution(countDownLatch);
+          interruptTaskExecution(Optional.of(countDownLatch));
 
 Review comment:
   Also: should we just call cancel 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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to