[ 
https://issues.apache.org/jira/browse/GOBBLIN-1068?focusedWorklogId=418728&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-418728
 ]

ASF GitHub Bot logged work on GOBBLIN-1068:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Apr/20 17:15
            Start Date: 08/Apr/20 17:15
    Worklog Time Spent: 10m 
      Work Description: arjun4084346 commented on pull request #2907: 
[GOBBLIN-1068]Clean up cyclic logic in task cancellation
URL: https://github.com/apache/incubator-gobblin/pull/2907#discussion_r405683659
 
 

 ##########
 File path: 
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/GobblinMultiTaskAttempt.java
 ##########
 @@ -416,14 +425,17 @@ private boolean taskSuccessfulInPriorAttempt(String 
taskId) {
           // task could not be created, so directly count down
           countDownLatch.countDown();
           log.error("Could not create task for workunit {}", workUnit, e);
-        } else if (!task.hasTaskFuture()) {
+        } else if (taskFuture == null) {
           // Task was created and may have been registered, but not submitted, 
so call the
           // task state tracker task run completion directly since the task 
cancel does nothing if not submitted
           this.taskStateTracker.onTaskRunCompletion(task);
           log.error("Could not submit task for workunit {}", workUnit, e);
         } else {
-          // task was created and submitted, but failed later, so cancel the 
task to decrement the CountDownLatch
-          task.cancel();
+          // task was created and submitted, but failed later(and still pop 
back here), so cancel the task to decrement the CountDownLatch
+          if (!taskFuture.cancel(true)) {
+            log.error("Failure in terminating submitted task");
+          }
+          this.taskStateTracker.onTaskRunCompletion(task);
 
 Review comment:
   Do we want to call `this.taskStateTracker.onTaskRunCompletion(task)` if 
`taskFuture.cancel(true)` returns false?
 
----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 418728)
    Time Spent: 3h 20m  (was: 3h 10m)

> Clean cyclic logic in task cancellation in Gobblin Task
> -------------------------------------------------------
>
>                 Key: GOBBLIN-1068
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1068
>             Project: Apache Gobblin
>          Issue Type: Bug
>            Reporter: Lei Sun
>            Priority: Major
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to