gnodet-bot commented on code in PR #30628:
URL: https://github.com/apache/camel/pull/30628#discussion_r4660811553


##########
components/camel-netty/src/main/java/org/apache/camel/component/netty/TimeoutCorrelationManagerSupport.java:
##########
@@ -239,6 +258,22 @@ private void onEviction(Type type, String key, 
NettyCamelState value) {
                 }
                 callback.done(false);
             }
-        });
+        };
+        ExecutorService pool = workerPool;
+        if (pool != null) {
+            try {
+                pool.submit(task);
+            } catch (RejectedExecutionException e) {
+                LOG.debug("The worker pool rejected the timeout of correlation 
id: {}. Running it in this thread.", key);
+                task.run();
+                return;
+            }
+        }
+        if (pool == null || pool.isShutdown()) {

Review Comment:
   After a successful `pool.submit(task)`, control falls through here. If the 
pool shuts down between the submit and the `isShutdown()` check, `task.run()` 
runs the task body a second time while the submitted task may still be queued 
in the pool. `markDone()` prevents double-completion but not the double-run. A 
`return` after `pool.submit(task)` avoids this.



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