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


##########
components/camel-ai/camel-mcp-server/src/main/java/org/apache/camel/component/mcp/server/vertx/VertxMcpStreamableServerTransportProvider.java:
##########
@@ -338,6 +469,35 @@ private void endWithStatus(Context connection, 
RoutingContext ctx, int status) {
         connection.runOnContext(v -> 
ctx.response().setStatusCode(status).end());
     }
 
+    private static final class ManagedSession {
+
+        private final McpStreamableServerSession session;
+        private volatile long lastActivityNanos;
+        private volatile int consecutivePingFailures;

Review Comment:
   Minor: `++consecutivePingFailures` on a `volatile int` is not atomic — it's 
a read-modify-write. Since `touch()` can reset this field concurrently from 
HTTP handler threads (both run via `executeBlocking(... false)` on different 
worker threads), this is technically a data race.
   
   Practically benign (a lost reset just means the session survives one extra 
ping cycle), but `AtomicInteger` with `incrementAndGet()` / `set(0)` would 
eliminate the race cleanly.



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