Croway commented on code in PR #24587:
URL: https://github.com/apache/camel/pull/24587#discussion_r3559450538


##########
components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIEndpoint.java:
##########
@@ -86,11 +88,12 @@ public class OpenAIEndpoint extends DefaultEndpoint {
 
     private OpenAIClient client;
 
-    private List<ChatCompletionFunctionTool> cachedMcpTools;
-    private Map<String, McpSyncClient> toolClientMap;
-    private Set<String> returnDirectTools;
+    private Map<String, ReentrantLock> mcpClientLocks;

Review Comment:
   Minor: `mcpClientLocks` (and `serverConfigs`) are written in `doStart` and 
read from exchange threads but are not `volatile`, while the other four fields 
now are. Camel's service lifecycle provides the happens-before in practice, but 
since this PR is explicitly about visibility, making these `volatile` too keeps 
the reasoning uniform.



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