Skip to content

Conversation

@findleyr
Copy link
Contributor

If a stateful streamable session fails to initialize, it is unusable. Avoid allocating resources by closing the session immediately.

Also:

  • Fix a bug where InitializeParams is not guarded with its mutex.
  • Fix a resource leak where sessions are persisted with session id "", even though they are unaddressable.
  • Add a relevant benchmark, and update tests.

Fixes #578

If a stateful streamable session fails to initialize, it is unusable.
Avoid allocating resources by closing the session immediately.

Also:
- Fix a bug where InitializeParams is not guarded with its mutex.
- Fix a resource leak where sessions are persisted with session id "",
  even though they are unaddressable.
- Add a relevant benchmark, and update tests.

Fixes modelcontextprotocol#578
@findleyr findleyr merged commit d256a9c into modelcontextprotocol:main Oct 27, 2025
5 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.

Streamable HTTP: don't allocate resources for failed connections

2 participants