[ https://issues.apache.org/jira/browse/GOBBLIN-1068?focusedWorklogId=416752&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-416752 ]
ASF GitHub Bot logged work on GOBBLIN-1068: ------------------------------------------- Author: ASF GitHub Bot Created on: 06/Apr/20 16:45 Start Date: 06/Apr/20 16:45 Worklog Time Spent: 10m Work Description: sv2000 commented on pull request #2907: [GOBBLIN-1068]Clean up cyclic logic in task cancellation URL: https://github.com/apache/incubator-gobblin/pull/2907#discussion_r404219750 ########## 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: Optional is not intended to be used as a function parameter and should be used only as a return value. [Here](https://www.quora.com/Why-is-using-java-util-Optional-as-a-method-parameter-not-recommended) is one of several references describing the problems with using Optional as a function parameter. ---------------------------------------------------------------- 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: 416752) Time Spent: 2h (was: 1h 50m) > 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: 2h > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.4#803005)