xdsclient: do not process updates from closed server channels#8389
Merged
easwars merged 1 commit intogrpc:masterfrom Jul 29, 2025
Merged
xdsclient: do not process updates from closed server channels#8389easwars merged 1 commit intogrpc:masterfrom
easwars merged 1 commit intogrpc:masterfrom
Conversation
Contributor
Author
|
Fixes internal issue: https://b.corp.google.com/issues/408227990 |
Contributor
Author
|
@purnesh42H : FYI since the migration PR got rolled back. If this goes in before that eventual roll-forward, we need to ensure that we don't lose track of this fix. Thanks. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8389 +/- ##
==========================================
- Coverage 82.48% 82.39% -0.10%
==========================================
Files 413 413
Lines 40511 40518 +7
==========================================
- Hits 33417 33384 -33
- Misses 5737 5773 +36
- Partials 1357 1361 +4
🚀 New features to boost your workflow:
|
dimpavloff
pushed a commit
to dimpavloff/grpc-go
that referenced
this pull request
Aug 22, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The xDS client is currently making an incorrect assumption that can lead to panics.
When an xDS client authority receives a response from a server, it checks to see if the response is from the currently active channel. If not, it assumes that it is from a higher priority server (because when a response is received from a server, all lower priority servers are closed), and therefore expects that a channel to that server exists. This need not be true because the responses are not handled inline, but are handled in the serializer. Here is a possible sequence:
A, B, C(in priority order).AandBare DOWN, andCis UP. Therefore the active channel is nowC.T0, the authority receives a message from serverB. This is not handled inline, but is queued in the serializer for handling.T1, the authority receives a message from serverC. This is not handled inline, but is queued in the serializer for handling.T2, the serializer handles the message from serverBand as part of this handling, releases the reference to serverCas it has now seen a response from a higher priority server. Also, the active channel now becomesB.T3, the serializer handles the message from serverC, and implicitly (wrongly) assumes that since it is not from the currently active channelB, it must be from a higher priority server and expects a channel to be present for that server.This fix ensures what when the authority receives a response from a server that is not currently the active channel, it must ensure that it is from a higher priority server before proceeding with handling that response. If it is not from a higher priority server, it should drop the response on the floor and move on.
RELEASE NOTES: