-
Notifications
You must be signed in to change notification settings - Fork 241
Closed
Labels
bugSomething isn't workingSomething isn't workingtriageIssues / Features awaiting triageIssues / Features awaiting triage
Milestone
Description
🐞 Bug Summary
When multiple sessions are connected to gateway, we get a Runtime error.
readuntil() called while another coroutine is already waiting for incoming data
🧩 Affected Component
Select the area of the project impacted:
-
mcpgateway
- API -
mcpgateway
- UI (admin panel) -
mcpgateway.wrapper
- stdio wrapper - Federation or Transports
- CLI, Makefiles, or shell scripts
- Container setup (Docker/Podman/Compose)
- Other (explain below)
🔁 Steps to Reproduce
- Create two sessions at the same time
- Second session gets errors as above
🤔 Expected Behavior
Multiple sessions should be supported
📓 Logs / Error Output
INFO [mcpgateway.cache.session_registry] Cleaned up pubsub for session 0cc79086-2885-46a0-8ac7-79a0f1b3451a
ERROR [asyncio] Task exception was never retrieved
future: <Task finished name='Task-106' coro=<SessionRegistry.respond() done, defined at /app/mcpgateway/cache/session_registry.py:517> exception=RuntimeError('readuntil() called while another coroutine is already waiting for incoming data')>
Traceback (most recent call last):
File "/app/mcpgateway/cache/session_registry.py", line 548, in respond
async for msg in self._pubsub.listen():
File "/app/.venv/lib64/python3.11/site-packages/redis/asyncio/client.py", line 1097, in listen
response = await self.handle_message(await self.parse_response(block=True))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib64/python3.11/site-packages/redis/asyncio/client.py", line 984, in parse_response
response = await self._execute(
^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib64/python3.11/site-packages/redis/asyncio/client.py", line 964, in _execute
return await conn.retry.call_with_retry(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib64/python3.11/site-packages/redis/asyncio/retry.py", line 71, in call_with_retry
return await do()
^^^^^^^^^^
File "/app/.venv/lib64/python3.11/site-packages/redis/asyncio/connection.py", line 594, in read_response
response = await self._parser.read_response(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib64/python3.11/site-packages/redis/_parsers/resp2.py", line 82, in read_response
response = await self._read_response(disable_decoding=disable_decoding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib64/python3.11/site-packages/redis/_parsers/resp2.py", line 90, in _read_response
raw = await self._readline()
^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib64/python3.11/site-packages/redis/_parsers/base.py", line 283, in _readline
data = await self._stream.readline()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/asyncio/streams.py", line 566, in readline
line = await self.readuntil(sep)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/asyncio/streams.py", line 658, in readuntil
await self._wait_for_data('readuntil')
File "/usr/lib64/python3.11/asyncio/streams.py", line 529, in _wait_for_data
raise RuntimeError(
RuntimeError: readuntil() called while another coroutine is already waiting for incoming data
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtriageIssues / Features awaiting triageIssues / Features awaiting triage