Skip to content

Fix thread-unsafe singleton pattern in MCPManager#832

Open
Jah-yee wants to merge 2 commits intoQwenLM:mainfrom
Jah-yee:fix/mcp-manager-thread-safe
Open

Fix thread-unsafe singleton pattern in MCPManager#832
Jah-yee wants to merge 2 commits intoQwenLM:mainfrom
Jah-yee:fix/mcp-manager-thread-safe

Conversation

@Jah-yee
Copy link
Copy Markdown

@Jah-yee Jah-yee commented Mar 12, 2026

Fixes #812

Add thread-safe singleton using double-checked locking pattern. This prevents race conditions when multiple threads try to create the MCPManager instance simultaneously.

RoomWithOutRoof and others added 2 commits March 12, 2026 14:51
The example code incorrectly uses request.get() instead of requests.get().
This is a simple documentation fix to ensure accuracy.
Add thread-safe singleton using double-checked locking pattern.
This prevents race conditions when multiple threads try to create
the MCPManager instance simultaneously (e.g., in Gradio WebUI
or ASGI server environments).

Fixes: QwenLM#812
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thread unsafe singleton pattern in MCPManager

1 participant