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_r404229876
########## File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/Task.java ########## @@ -394,15 +391,8 @@ public void run() { } catch (Throwable t) { failTask(t); } finally { - synchronized (this) { - if (this.taskFuture == null || !this.taskFuture.isCancelled()) { - this.taskStateTracker.onTaskRunCompletion(this); - completeShutdown(); - this.taskFuture = null; - } else { - LOG.info("will not decrease count down latch as this task is cancelled"); - } - } + this.taskStateTracker.onTaskRunCompletion(this); Review comment: Is the removing of the synchronized block intentional? Is there a chance that Task#cancel() is invoked from multiple threads? ---------------------------------------------------------------- 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