Repository navigation
Fix HTTP/2 error after response completion - #925
Closed
Alex-Wengg wants to merge 1 commit into
Closed
Alex-Wengg wants to merge 1 commit into
Alex-Wengg wants to merge 1 commit into
Conversation
Motivation: An HTTP/2 stream error can arrive after a response end has completed the request while its request body is still streaming. The handler cleared the request on response completion and then force-unwrapped it while processing the later error, causing a crash. Modifications: Only fail the request when it is still present, while preserving timer and stream cleanup. Add a regression test for an error following a completed response during a streaming upload. Result: Late HTTP/2 stream errors no longer crash HTTP2ClientRequestHandler or fail an already-completed request.
Author
|
Closing because I’m changing contribution focus. Thank you. |
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:
An HTTP/2 stream error can arrive after a response end has completed the request while its request body is still streaming.
HTTP2ClientRequestHandlerclears the request on response completion and then force-unwraps it while processing the later error, causing the crash reported in #922.Modifications:
Result:
Late HTTP/2 stream errors no longer crash the handler or fail an already-completed request.
Validation:
swift buildswift format lint --strict --configuration .swift-formaton both changed filesHTTP2ClientRequestHandler#922, pointed at this checkout: receives200 OK, completes normally, and exits 0 (unmodified 1.36.1 exits 133 atHTTP2ClientRequestHandler.swift:249).Fixes #922