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

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

                Author: ASF GitHub Bot
            Created on: 13/Feb/20 01:03
            Start Date: 13/Feb/20 01:03
    Worklog Time Spent: 10m 
      Work Description: autumnust commented on pull request #2882: 
[GOBBLIN-1042] Fix ForkMetric incorrect return type of parent metric object and 
relevant unit tests 
URL: https://github.com/apache/incubator-gobblin/pull/2882#discussion_r378599944
 
 

 ##########
 File path: 
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/GobblinMultiTaskAttempt.java
 ##########
 @@ -400,15 +403,20 @@ 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()) {
-          // 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();
-          log.error("Failure after task submitted for workunit {}", workUnit, 
e);
+          if (!task.hasTaskFuture()) {
+            // 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();
+            log.error("Failure after task submitted for workunit {}", 
workUnit, e);
+          }
+
+          // Remove entry in the metrics registry when task failed to be 
executed .
+          this.cleanMetrics();
 
 Review comment:
   Looks like I shouldn't clean the metric registry since it is a class-static 
variable shared by all instances. Adjust the logic. 
 
----------------------------------------------------------------
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


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

    Worklog Id:     (was: 386332)
    Time Spent: 1h  (was: 50m)

> ForkMetrics generates parent metric object with incorrect type
> --------------------------------------------------------------
>
>                 Key: GOBBLIN-1042
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1042
>             Project: Apache Gobblin
>          Issue Type: Improvement
>            Reporter: Lei Sun
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>




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

Reply via email to