davsclaus commented on code in PR #27918:
URL: https://github.com/apache/camel/pull/27918#discussion_r4291166265
##########
components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoAbstractConsumerThread.java:
##########
@@ -101,6 +101,17 @@ public void run() {
try {
while (keepRunning) {
Review Comment:
One edge case this opens: an interrupt that arrives while `keepRunning` is
still true now makes the loop spin. The sleep catch re-sets the flag, the next
`initializeCursor()` fails at once with `MongoInterruptedException` (the
driver's server selection waits interruptibly), that is now caught and logged
as a WARN with stack trace, and `Thread.sleep` throws straight away again.
Before, the same interrupt ended the thread. Could the loop stop on interrupt?
```suggestion
while (keepRunning && !Thread.currentThread().isInterrupted()) {
```
--
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]