-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Override gRPC Context storage #28199
Conversation
a2d1b06
to
ad9139f
Compare
This comment has been minimized.
This comment has been minimized.
The problem comes from the default gRPC context storage using a thread-local. This commit overrides the storage implementation (using the recommended method) to use the duplicated context and fallback to a thread-local.
ad9139f
to
b82b235
Compare
The oidc code flow test failure is unrelated - which will be disabled in #28209 |
Failing Jobs - Building b82b235
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 17 #- Failing: integration-tests/oidc-code-flow
📦 integration-tests/oidc-code-flow✖
|
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.
Looks fine to me but I'm not familiar with this stuff so feel free to seek for another reviewer you trust more :).
/** | ||
* Override gRPC context storage to rely on duplicated context when available. | ||
*/ | ||
public class ContextStorageOverride extends Context.Storage { |
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.
wow that's nasty (in gRPC) , the io.grpc.override.ContextStorageOverride
hardcoded class.
The problem comes from the default gRPC context storage using a thread-local.
This commit overrides the storage implementation (using the recommended method) to use the duplicated context and fallback to a thread-local.