-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
filter stack: pass peer name up via recv_initial_metadata batch #31933
Merged
Conversation
This file contains 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
markdroth
added
the
release notes: no
Indicates if PR should not be in release notes
label
Dec 19, 2022
grpc-checks
bot
added
per-call-memory/increase
per-channel-memory/neutral
bloat/none
labels
Feb 3, 2023
Automated fix for refs/heads/peer_address_cleanup
ctiller
approved these changes
Feb 15, 2023
ctiller
pushed a commit
that referenced
this pull request
Feb 16, 2023
copybara-service
bot
added
the
imported
Specifies if the PR has been imported to the internal repository
label
Feb 16, 2023
markdroth
added
release notes: yes
Indicates if PR needs to be in release notes
and removed
release notes: no
Indicates if PR should not be in release notes
labels
Mar 21, 2023
XuanWang-Amos
pushed a commit
to XuanWang-Amos/grpc
that referenced
this pull request
May 1, 2023
…#31933) Currently, the peer name is returned with the completion of the send_initial_metadata op, which does not make sense, because with retries, we don't actually know the peer name until we complete the recv_initial_metadata op. This PR changes our code to return the peer string as an attribute of the recv_initial_metadata op, so that it is not available to the application until that point. This change may be user-visible, but since our API docs don't seem to guarantee exactly when this data will be available, it's not technically a breaking change. Note that in the promise-based stack, we were already assuming that the peer string would be returned as part of the recv_initial_metadata batch, so this PR helps reduce risk for the promise conversion by making this semantic change now, thus decoupling it from the promise conversion. I have also changed the representation of the string in the metadata batch to be a `grpc_core::Slice` instead of a `std::string`, so that we can just take a ref to the string held in the transport instead of having to copy the whole string for every call.
XuanWang-Amos
pushed a commit
to XuanWang-Amos/grpc
that referenced
this pull request
May 1, 2023
XuanWang-Amos
pushed a commit
to XuanWang-Amos/grpc
that referenced
this pull request
May 1, 2023
…data batch (grpc#32417) Original attempt was grpc#31933, reverted in grpc#32415.
wanlin31
pushed a commit
that referenced
this pull request
May 18, 2023
Currently, the peer name is returned with the completion of the send_initial_metadata op, which does not make sense, because with retries, we don't actually know the peer name until we complete the recv_initial_metadata op. This PR changes our code to return the peer string as an attribute of the recv_initial_metadata op, so that it is not available to the application until that point. This change may be user-visible, but since our API docs don't seem to guarantee exactly when this data will be available, it's not technically a breaking change. Note that in the promise-based stack, we were already assuming that the peer string would be returned as part of the recv_initial_metadata batch, so this PR helps reduce risk for the promise conversion by making this semantic change now, thus decoupling it from the promise conversion. I have also changed the representation of the string in the metadata batch to be a `grpc_core::Slice` instead of a `std::string`, so that we can just take a ref to the string held in the transport instead of having to copy the whole string for every call.
wanlin31
pushed a commit
that referenced
this pull request
May 18, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bloat/medium
disposition/Needs Internal Changes
imported
Specifies if the PR has been imported to the internal repository
lang/c++
lang/core
per-call-memory/increase
per-channel-memory/neutral
release notes: yes
Indicates if PR needs to be in release notes
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.
Currently, the peer name is returned with the completion of the send_initial_metadata op, which does not make sense, because with retries, we don't actually know the peer name until we complete the recv_initial_metadata op. This PR changes our code to return the peer string as an attribute of the recv_initial_metadata op, so that it is not available to the application until that point. This change may be user-visible, but since our API docs don't seem to guarantee exactly when this data will be available, it's not technically a breaking change.
Note that in the promise-based stack, we were already assuming that the peer string would be returned as part of the recv_initial_metadata batch, so this PR helps reduce risk for the promise conversion by making this semantic change now, thus decoupling it from the promise conversion.
I have also changed the representation of the string in the metadata batch to be a
grpc_core::Slice
instead of astd::string
, so that we can just take a ref to the string held in the transport instead of having to copy the whole string for every call.