Roo-Code/src
MuriloFP c9be470319 fix: prevent race conditions in McpServerManager singleton initialization
Added thread-safe initialization to the McpServerManager singleton pattern to
prevent potential race conditions when getInstance is called concurrently.
The changes include:

1. Added initializationPromise to track ongoing initialization
2. Implemented double-checked locking pattern:
   - First check: Return existing instance if available
   - Second check: Wait for any ongoing initialization
   - Third check: Double-check inside initialization block
3. Added proper cleanup in finally block to prevent deadlocks

This ensures that:
- Only one McpHub instance is ever created
- Concurrent calls wait for initialization to complete
- Resources are properly initialized and cleaned up
- No memory leaks from incomplete initialization

The fix maintains the existing functionality while making it safe for
concurrent access in VS Code's multi-window environment.
2025-02-07 17:12:39 -03:00
..
__mocks__ Fix tests 2025-02-01 12:21:13 -05:00
activate add user input 2025-02-06 10:48:34 +07:00
api Prevent provider client instantiations from throwing 2025-02-07 03:06:01 -08:00
core fix: ensure MCP server list appears in settings when server starts first 2025-02-07 16:57:21 -03:00
exports fix: correct VSCode URI 2025-01-15 08:24:21 +11:00
integrations feat: add terminal integration commands 2025-02-06 10:27:12 +07:00
services fix: prevent race conditions in McpServerManager singleton initialization 2025-02-07 17:12:39 -03:00
shared Merge pull request #807 from samhvw8/feat/terminal-menu-context 2025-02-05 23:41:32 -05:00
test Fall back to js bundle when local webview app not running in development 2025-02-03 09:19:52 -08:00
utils Safer profile path check 2025-02-04 23:59:36 -05:00
extension.ts fix: Implement singleton pattern for MCP server management to prevent multiple instances 2025-02-07 15:51:30 -03:00