GeezerVison is showing github.com — fix: use a new managed channel builder when creating channels by mutianf · Pull Request #13684 · googleapis/google-cloud-java
Conversation
mutianf
commented
Jul 7, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
ChannelPoolDpImpl calls the channel supplier many times over a pool's lifetime — at warm-up, on load-driven resize, on capacity misses in newStream, and on channel recycles.
gRPC builders are mutating: intercept(...) appends to an internal list, and build() snapshots the current list into the new channel. So if anything installs an interceptor on the shared builder between builds, that interceptor accumulates. If the interceptor includes any headers, this causes all the headers to accumulate.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
gemini-code-assist[bot] reacted with eyes emoji
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.
Code Review
This pull request refactors SwitchingChannelPool to prevent interceptor accumulation by ensuring a fresh ManagedChannelBuilder is created for each channel supplier invocation, rather than reusing a single builder. It also adds a regression test to verify this behavior. The review feedback suggests improving the test teardown process by awaiting the termination of the server and executor to prevent potential thread leaks or port binding issues.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
sushanb
sushanb approved these changes
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.