Skip to content

Comments

fix: handle_sse_response causing dangling client's read_stream #1812

Open
ivanbelenky wants to merge 2 commits intomodelcontextprotocol:mainfrom
ivanbelenky:main
Open

fix: handle_sse_response causing dangling client's read_stream #1812
ivanbelenky wants to merge 2 commits intomodelcontextprotocol:mainfrom
ivanbelenky:main

Conversation

@ivanbelenky
Copy link

Notifying session layer on transport error. Sending the error to the client's read_stream_writer.

Motivation and Context

Indefinitely hang described on issue #1811

How Has This Been Tested?

Running suite of tests locally as per contribution guidelines.

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@ivanbelenky ivanbelenky changed the title draft commit of solution to issue #1811 fix: handle_sse_response causing dangling client's read_stream Dec 21, 2025
@ivanbelenky ivanbelenky marked this pull request as ready for review December 23, 2025 03:28
@maxisbey maxisbey added bug Something isn't working P1 Significant bug affecting many users, highly requested feature labels Dec 31, 2025
@heyhayes
Copy link

Hey @ivanbelenky — thanks for identifying this root cause, your analysis was spot on. PR #2122 covers the same fix (sending a JSONRPCError when the SSE stream ends without a response) and also addresses the infinite reconnection loop in _handle_reconnection and handle_get_stream that was reported in #1789. Just wanted to flag the overlap so we don't duplicate effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working P1 Significant bug affecting many users, highly requested feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants