Repository navigation
re_grpc: end a finished action's Execute stream with the server, not with a reset - #1651
Open
jun-mercury wants to merge 1 commit into
Open
jun-mercury wants to merge 1 commit into
jun-mercury wants to merge 1 commit into
Conversation
…with a reset The executor drops an action's Execute stream once its done Operation is in, and h2 resets a dropped stream with CANCEL while the server's trailers are still on the way. h2 keeps only a bounded set of recently reset streams. A frame that arrives for one it has forgotten is answered with a reset that h2 counts against the connection, and that count never goes down (h2 0.4 src/proto/streams). Over a long-lived daemon the 1025th becomes GOAWAY ENHANCE_YOUR_CALM "too_many_internal_resets", the error the comment on retrying_stream in execute_with_progress names, and every stream on the connection fails with it. The stream that execute_with_progress opens now ends at the done Operation, so retrying_stream never reads past it and so never retries a reset that comes after it. When the stream is dropped, a task reads what is left of it to the server's END_STREAM, for at most 2 s. BuildBuddy writes the trailers right after the done Operation, and a stream held open longer keeps one of the server's concurrent streams. A stream dropped before its done Operation is still reset, which is what tells the server to stop. Assisted-by: Claude:claude-opus-5-5
Contributor
|
This pull request has been imported. If you are a Meta employee, you can view this in D134506953. (Because this pull request was imported automatically, there will not be any future comments.) |
This branch has not been deployed
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.
Summary
The executor drops an action's Execute stream once its done Operation arrives, and h2 resets the dropped stream with CANCEL while the server's trailers are still in flight. h2 remembers only a bounded set of recently reset streams. A frame for a stream it has forgotten is answered with a reset that h2 counts against the connection, and that count never goes down (h2 0.4,
src/proto/streams). Over a long-lived daemon, about the 1,025th such reset becomes GOAWAYENHANCE_YOUR_CALM"too_many_internal_resets", the error the comment onretrying_streaminexecute_with_progressnames, and every stream on the connection fails with it.The stream that
execute_with_progressopens now ends at the done Operation, soretrying_streamstops there, and a reset that comes after it isn't retried. When the stream is dropped, a task reads what's left of it up to the server's END_STREAM, for at most 2 s. BuildBuddy writes the trailers right after the done Operation, and a stream held open longer keeps one of the server's concurrent streams. A stream dropped before its done Operation is still reset, which is what tells the server to stop.Test plan
remote_execution/oss/re_grpc/src/client.rs: the stream ends at its done Operation, and its remainder is drained.cargo test -p remote_execution --lib: 56 passed.