-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Client requests hang forever if server dies #332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
9 tasks
I was about to open an issue on this as well. I use await asyncio.wait_for(session.initialize(), timeout=5) but it feels pretty bad. |
Same problem here (#428), same asyncio.wait_for based ugly workaround for now. |
I have same problem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
If the stdio streams close before responding to a request (i.e. the server dies), the pending request waits forever (or for the read timeout) instead of erroring.
To Reproduce
Steps to reproduce the behavior:
await session.initialize()
or some other requestawait
never resolves so the client hangs indefinitelyExpected behavior
The typescript SDK makes the pending requests return a
-32000
"Connection closed" in this casehttps://github.com/modelcontextprotocol/typescript-sdk/blob/0fa2397174eba309b54575294d56754c52b13a65/src/shared/protocol.ts#L260-L263
The text was updated successfully, but these errors were encountered: