apupier commented on code in PR #30711:
URL: https://github.com/apache/camel/pull/30711#discussion_r4677380972


##########
components/camel-ai/camel-semantic/src/main/java/org/apache/camel/semantic/SemanticEvaluateConsole.java:
##########
@@ -76,6 +78,8 @@ private synchronized ExecutorService executor() throws 
Exception {
     @Override
     protected synchronized void doStart() throws Exception {
         stopped = false;
+        active.drainPermits();
+        active.release(2);

Review Comment:
   Updated to use `AtomicInteger` with a CAS-based guard bounded at 2 and 
clamped releases (`updateAndGet(count -> Math.max(0, count - 1))`), avoiding 
permit leaks on lifecycle restarts.



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