You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
async with ClientSession(
read, write, timedelta(seconds=60 * 5)
) as session:
await session.initialize()
I turned on debug log, and I can see in log, the timeout is 5. [2025-04-10 21:45:10,055] [DEBUG] [httpcore.connection]: connect_tcp.started host='xxx' port=xxx local_address=None timeout=5.0 socket_options=None
And I debugged into AnyIO, the timeout outputted in log is connect timeout, but timeout for connect/read/write/pool are all 5.
It seems because timeout isn't set at here, httpx uses its default timeout which is 5 seconds.
So when it takes more than 5 seconds, exception ReadTimeout('') happens here
I turned on debug log, and I can see in log, the timeout is 5.
[2025-04-10 21:45:10,055] [DEBUG] [httpcore.connection]: connect_tcp.started host='xxx' port=xxx local_address=None timeout=5.0 socket_options=None
And I debugged into AnyIO, the timeout outputted in log is connect timeout, but timeout for connect/read/write/pool are all 5.
Though
https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/shared/session.py#L247-L252
has the timeout logic, but I always get
[2025-04-10 22:12:21,674] [DEBUG] [httpcore.http11]: receive_response_headers.failed exception=ReadTimeout(TimeoutError())
this error, if it takes more than 5 seconds.
The text was updated successfully, but these errors were encountered: