davsclaus commented on code in PR #27918:
URL: https://github.com/apache/camel/pull/27918#discussion_r4302183176


##########
components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoAbstractConsumerThread.java:
##########
@@ -99,8 +99,20 @@ protected boolean processExchange(Exchange exchange) {
     public void run() {
         stoppedLatch = new CountDownLatch(1);
         try {
-            while (keepRunning) {
+            // an interrupt ends the thread, as it did before the cursor was 
reopened inside the try
+            while (keepRunning && !Thread.currentThread().isInterrupted()) {
                 try {
+                    if (cursor == null) {
+                        // a new cursor after the previous one ended. It is 
opened here, inside the try, so that a
+                        // failure to open it (the server cannot be reached 
yet) is reported and tried again after
+                        // the delay, instead of ending this thread while the 
consumer stays started

Review Comment:
   @allthingssecurity offered to do this as a follow-up with its own test (the 
stack trace only for the first of consecutive failures), so this PR stays about 
the consumer thread surviving. Resolving to merge; @allthingssecurity, please 
open a JIRA for the follow-up so it is not lost.
   
   _Claude Code on behalf of Claus Ibsen_



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