-
Notifications
You must be signed in to change notification settings - Fork 4.7k
transport: surface subsequent data when receiving non-gRPC header #8929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chengxilo
wants to merge
26
commits into
grpc:master
Choose a base branch
from
chengxilo:surface-response-body
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+262
−13
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
3dc8573
feat: surface response data when receiving an unexpected status code …
chengxilo 3cd1bf5
refactor: remove nonGRPCDataCollectionState enum, use collecting(bool…
chengxilo 95cf20b
Merge branch 'grpc:master' into surface-response-body
chengxilo 038dd99
refactor: stop exporting constant nonGRPCDataMaxLen
chengxilo 6dd9c4f
refactor: remove unnecessary timer
chengxilo 4e270af
refactor: replace unnecessary mutex with atmoic.Bool
chengxilo b59203a
style: inline errMsg to simplify error message joining
chengxilo 685f4ef
Revert "refactor: replace unnecessary mutex with atmoic.Bool"
chengxilo b6f3bf2
Merge branch 'master' into surface-response-body
chengxilo 1effa8e
Merge branch 'master' into surface-response-body
chengxilo e60496c
doc: update stale comment
chengxilo 8725f9f
fix: hold collectionMu in Status()
chengxilo 3ae8eaf
Merge branch 'master' into surface-response-body
chengxilo a83d60e
Revert "fix: hold collectionMu in Status()"
chengxilo 6e579f2
refactor: refactor the process to finalize the data collected from no…
chengxilo 7895aef
doc: add comment for collectionMu
chengxilo e3d1434
refactor: introduce nonGRPCStatus field and inline finalization in cl…
chengxilo 2069ce9
refactor: defer headerChan closure until stream closes for non-gRPC r…
chengxilo 15e67d0
test: split headerChan test into non-gRPC response and malformed head…
chengxilo db6ea10
chore: change invalidHeaderField to invalidContentType for readability
chengxilo 6afa8f8
refactor: inline closeNonGRPCStream and provide comment to clarify
chengxilo df12e44
docs: provide explanation for nonGRPCStatus finalize
chengxilo f5c04f2
typo: if is not -> if not
chengxilo 44e4144
chore: nix this newline
chengxilo 0d23730
style: avoid checking the code again in wantErr
chengxilo df306a0
style: improve the Errorf output
chengxilo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we may not need the mutex here. The three places where the
nonGRPCfields are accessed are:operateHeadershandleDatacloseStreamMethods 1 and 2 are called serially by the goroutine running the
controlbufloop.Method 3 reads the fields to overrides the arguments passed to it. This seems undesirable because it ignores the status passed by the caller.
The way to gracefully close streams in HTTP/2 is by using the "end of stream" (EOS) flag in the frame header. Since this flag is only present in
HEADERSandDATAframes, we should haveoperateHeadersandhandleDatacheck thenonGRPCStatus, callcloseStreamwith the resolved status, and remove the extra logic fromcloseStream. This approach should also eliminate the need for the mutex.