Repository navigation
Conversation
## Motivation and Context With `stream_request_notifications: true`, the notifications and keepalives of a streamed request each wait for the client for at most `stream_write_timeout:` seconds, but the response that ends the stream was written without any deadline, since it may be large. The stream of a 2026-07-28 request belongs to no session, so nothing else ends it either: a client that stopped reading held the thread serving the request, and the keepalive thread waiting on the stream's write mutex, until it closed the connection. The response is now written in pieces of 64 KiB, each given `stream_write_timeout:` seconds. A client that takes each piece in that time receives all of it however long the whole takes, and one that does not is dropped as it is for any other frame. `stream_write_timeout: nil` still waits without limit. ## How Has This Been Tested? `test/mcp/server/transports/streamable_http_stream_request_notifications_test.rb`. Against the previous library the request of a client that does not read never ends. ## Breaking Changes None.
koic
deleted the
bound_the_write_of_the_response_of_a_streamed_request
branch
November 27, 2026 20:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
With
stream_request_notifications: true, the notifications and keepalives of a streamed request each wait for the client for at moststream_write_timeout:seconds, but the response that ends the stream was written without any deadline, since it may be large. The stream of a 2026-07-28 request belongs to no session, so nothing else ends it either: a client that stopped reading held the thread serving the request, and the keepalive thread waiting on the stream's write mutex, until it closed the connection.The response is now written in pieces of 64 KiB, each given
stream_write_timeout:seconds. A client that takes each piece in that time receives all of it however long the whole takes, and one that does not is dropped as it is for any other frame.stream_write_timeout: nilstill waits without limit.How Has This Been Tested?
test/mcp/server/transports/streamable_http_stream_request_notifications_test.rb. Against the previous library the request of a client that does not read never ends.Breaking Changes
None.
Types of changes
Checklist