sv2000 commented on issue #2919: [GOBBLIN-1078] Coordination between task cancel and initialization in Helix Task URL: https://github.com/apache/incubator-gobblin/pull/2919#issuecomment-601279473 @autumnust - On thinking more about the synchronization problem between GobblinMultiTaskAttempt#run() and cancel() methods, I think the following strategy might work. You can create a countdownLatch object that is shared between the run() and cancel() threads. When a cancel() is invoked, the countDownLatch is incremented. The cancel() may proceed to perform other actions but before it returns, it blocks until this latch is down to 0. The run() thread on the other hand, detects that the latch has been incremented, cancels the tasks submitted to the task executor, decrements the latch and returns. This should solve the synchronization issues between the threads without needing a lock/condition variable.
---------------------------------------------------------------- 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] With regards, Apache Git Services
