Skip to content

Fix StdioServerTransport.DisposeAsync hang #235

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

Merged
merged 7 commits into from
Apr 8, 2025

Conversation

halter73
Copy link
Contributor

@halter73 halter73 commented Apr 8, 2025

  • It's not just Unix, it's all platforms that can hang
  • Windows doesn't hang on Ctrl-C because that triggers the end of the Stream, but that doesn't help in IHostApplicationLifetime.StopAsync() scenarios

https://github.com/dotnet/runtime/blob/4e9627e311806330be72b7f7d3660be699878ebd/src/libraries/System.Console/src/System/ConsolePal.Unix.ConsoleStream.cs#L13 https://github.com/dotnet/runtime/blob/4e9627e311806330be72b7f7d3660be699878ebd/src/libraries/System.Console/src/System/ConsolePal.Windows.cs#L1149

Fixes #221

@halter73 halter73 force-pushed the cancel-stdio-read branch from 2aa0755 to e6a591b Compare April 8, 2025 08:01
@halter73 halter73 merged commit bab74d5 into modelcontextprotocol:main Apr 8, 2025
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ctrl-c doesn't cancel server on mac and linux
3 participants