You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Andrea Cosentino (Jira)" <ji...@apache.org> on 2026/08/27 04:45:00 UTC

[jira] [Work started] (CAMEL-24520) camel-ibm-watsonx-ai: lazy service getters on WatsonxAiEndpoint are not thread-safe

     [ https://issues.apache.org/jira/browse/CAMEL-24520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on CAMEL-24520 started by Andrea Cosentino.
------------------------------------------------
> camel-ibm-watsonx-ai: lazy service getters on WatsonxAiEndpoint are not thread-safe
> -----------------------------------------------------------------------------------
>
>                 Key: CAMEL-24520
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24520
>             Project: Camel
>          Issue Type: Bug
>            Reporter: Andrea Cosentino
>            Assignee: Andrea Cosentino
>            Priority: Major
>             Fix For: 4.23.0
>
>
> WatsonxAiEndpoint creates each watsonx.ai service lazily in its getter (for example getChatService(): if (chatService == null) chatService = WatsonxAiServiceFactory.createChatService(configuration);). The lazy initialization is intentional (avoid building service clients that an endpoint never uses, and avoid creating them on a started context) but is not synchronized, so two threads calling a getter concurrently on first use can both build a client; one is then leaked. Make the lazy getters thread-safe (synchronized) while keeping the lazy creation.\n\nAffected: components/camel-ibm/camel-ibm-watsonx-ai (org.apache.camel.component.ibm.watsonx.ai.WatsonxAiEndpoint service getters).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)