chore(gax): support request attempt interception via options extensions#6014
Draft
olavloite wants to merge 1 commit into
Draft
chore(gax): support request attempt interception via options extensions#6014olavloite wants to merge 1 commit into
olavloite wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces an attempt interceptor mechanism for gRPC requests, allowing custom headers to be injected or modified per attempt, including retries. It also adds integration tests to verify the interceptor's behavior. The review feedback suggests extending this interceptor support to bidirectional streaming requests to ensure consistent behavior across all RPC types.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6014 +/- ##
==========================================
- Coverage 97.73% 97.72% -0.01%
==========================================
Files 244 244
Lines 61161 61170 +9
==========================================
+ Hits 59776 59781 +5
- Misses 1385 1389 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
15b0941 to
bcec26d
Compare
Allow mutating request headers on every RPC attempt (including retries) by checking for a closure extension inside `RequestOptions`. If an `Arc<dyn Fn(&mut HeaderMap, u32) + Send + Sync>` is present in the request options extensions, it is executed before each request attempt with the 1-based attempt number. This enables downstream clients to inject and attempt-specific request headers without modifying the public API of `google-cloud-gax[-internal]` or introducing new public traits.
bcec26d to
5de816e
Compare
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.
Note: This is an alternative implementation of the same feature as #5966
Allow mutating request headers on every RPC attempt (including retries) by checking for a closure extension inside
RequestOptions.If an
Arc<dyn Fn(&mut HeaderMap, u32) + Send + Sync>is present in the request options extensions, it is executed before each request attempt with the 1-based attempt number. This enables downstream clients to inject and attempt-specific request headers without modifying the public API ofgoogle-cloud-gax[-internal]or introducing new public traits.