henrik242 commented on code in PR #26112:
URL: https://github.com/apache/camel/pull/26112#discussion_r3947938555


##########
components/camel-master/src/main/java/org/apache/camel/component/master/MasterConsumer.java:
##########
@@ -315,8 +329,12 @@ private boolean isStartPending() {
     }
 
     private void cancelLeaderTask(boolean mayInterruptIfRunning) {
-        if (leaderTaskFuture != null) {
-            leaderTaskFuture.cancel(mayInterruptIfRunning);
+        if (leaderTask != null) {
+            // cancelled through the task and not through its future, so the 
task also leaves the
+            // TaskManagerRegistry. Only a run of the task removes it from 
there, and once the schedule
+            // is cancelled no run is coming
+            leaderTask.cancel(mayInterruptIfRunning);
+            leaderTask = null;

Review Comment:
   Documented on the declarations, `MasterConsumer.java:66-70`. 
delegatedConsumer and view are volatile because they're read outside the lock; 
these two aren't.  



-- 
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]

Reply via email to