Henrik created CAMEL-24626:
------------------------------

             Summary: camel-master: follow-ups to CAMEL-24583 - leadership 
lock, cancelled task registry entries, backoff documentation
                 Key: CAMEL-24626
                 URL: https://issues.apache.org/jira/browse/CAMEL-24626
             Project: Camel
          Issue Type: Bug
          Components: camel-master, camel-sjms
    Affects Versions: 4.22.0
            Reporter: Henrik


Three issues found while fixing CAMEL-24583, none of them introduced or fixed 
there.

1. `BackgroundTask` scheduled through `schedule()` stays in the 
`TaskManagerRegistry` when the caller cancels the returned future. Only a run 
of the task removes the entry, and once the schedule is cancelled no run is 
coming, so the task is listed as an internal task and keeps its container 
reachable for the life of the context. This affects camel-sjms today and 
camel-master since CAMEL-24583.

2. `MasterConsumer` guards its leadership state with the `BaseService` lock. 
`doStop` holds that lock and needs the write lock of the cluster view to remove 
its listener, while `AbstractCamelClusterView` dispatches events holding its 
read lock and then needs the consumer lock. A leadership event that passes the 
`isRunAllowed` fast path just before a stop acquires the lock closes the two 
orders into a deadlock.

3. `backOffMaxAttempts` defaults to 10 attempts at 5s apart. A leader that uses 
them up keeps the leadership and consumes nothing until the leadership changes 
again. That is the documented intent, and `backOffMaxAttempts=0` already 
retries indefinitely, but neither the consequence nor the escape hatch is 
documented.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to