Skip to content
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
merged 11 commits into from Feb 16, 2023

Conversation

markdroth
Copy link
Member

@markdroth markdroth commented Dec 19, 2022

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.

@markdroth markdroth added the release notes: no Indicates if PR should not be in release notes label Dec 19, 2022
@grpc-checks grpc-checks bot added bloat/low and removed bloat/none labels Feb 3, 2023
@markdroth markdroth marked this pull request as ready for review February 3, 2023 20:34
@copybara-service copybara-service bot added the imported Specifies if the PR has been imported to the internal repository label Feb 16, 2023
markdroth added a commit that referenced this pull request Feb 22, 2023
@markdroth 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
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants