gansheer opened a new pull request, #25283:
URL: https://github.com/apache/camel/pull/25283

   # Description
   
   Fix a bug where the SJMS consumer becomes permanently dead after recovering 
from a JMS connection failure once — any subsequent connection failure cannot 
trigger recovery.
   
   **Root cause**
   
   [CAMEL-23646](https://issues.apache.org/jira/browse/CAMEL-23646) added a 
!recoverTask.isRunning() guard in scheduleConnectionRecovery() to allow 
re-scheduling after a completed task. However, BackgroundTask.schedule() sets 
running=true but never resets it (running is only cleared in 
waitForTaskCompletion(), which is the run() path, not the schedule() path).
   
     After the first successful recovery:
     1. recoverTask is non-null and isRunning() returns true forever
     2. The guard recoverTask == null || !recoverTask.isRunning() is 
permanently false
     3. If onException() fires again (transient broker event, Artemis internal 
cleanup), consumers/sessions are nulled with no recovery path
     4. Consumer is permanently dead
   
    **Fix**
   
   Reset recoverTask and recoverFuture to null (and cancel the scheduled 
future) after successful recovery. This re-arms the recovery mechanism so 
subsequent failures can schedule a new recovery  task.
   
   Claude Code on behalf of gansheer


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