fastmcp/tests/server/proxy
marvin-context-protocol[bot] 9cd457727d Fix stdio proxy race condition in concurrent connections
Resolves race condition where multiple parallel requests through FastMCP
proxy to stdio servers would fail with 'Received request before
initialization was complete' errors.

The issue occurred because each proxy operation created a new client that
tried to initialize simultaneously. Added _SynchronizedClientContext to
serialize stdio client initialization using asyncio semaphore while
preserving performance for non-stdio transports.

- Added _SynchronizedClientContext async context manager
- Enhanced ProxyManagerMixin with synchronized client context
- Updated all proxy managers to use synchronized context for stdio
- Added comprehensive tests with 20+ parallel operations
- All existing tests continue to pass

Co-authored-by: William Easton <strawgate@users.noreply.github.com>
2025-08-25 18:25:32 +00:00
..
__init__.py Fix concurrent proxy client operations with session isolation (#1083) 2025-07-08 17:22:43 -04:00
test_proxy_client.py Add _fastmcp meta namespace (#1290) 2025-07-29 15:07:53 -04:00
test_proxy_server.py Updates to tests 2025-08-24 10:59:01 -05:00
test_proxy_stdio_race_fix.py Fix stdio proxy race condition in concurrent connections 2025-08-25 18:25:32 +00:00
test_stateful_proxy_client.py Fix stateful proxy client mixing in multi-proxies sessions (#1245) 2025-07-23 15:39:50 -04:00