ZihanLi58 commented on code in PR #3699:
URL: https://github.com/apache/gobblin/pull/3699#discussion_r1207200903
##########
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinHelixTask.java:
##########
@@ -219,6 +228,7 @@ public void cancel() {
log.info("Gobblin helix task cancellation invoked for jobId {}.", jobId);
if (this.task != null ) {
try {
+ this.isCanceled = true;
Review Comment:
I set it earlier to make sure when line 171 "this.task.run();" finishes, it
can see the flag to be set already.
As cancel and run are two method runs in different threads, so want to avoid
race conditions here.
If we set it earlier, the worst case is even task finish successfully, as
long as we tried to call cancel, we will return as cancel. I think it's
acceptable, but let me you WDYT.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]