Reset configSelector on realChannel while entering IDLE state#12832
Reset configSelector on realChannel while entering IDLE state#12832kkalin68 wants to merge 2 commits into
Conversation
|
|
|
Hey, |
There was a problem hiding this comment.
Pull request overview
Fixes a ManagedChannel idle-mode edge case where a stale InternalConfigSelector can prevent the channel from properly exiting IDLE after xDS resources disappear and later reappear.
Changes:
- Reset
realChannel’s config selector toINITIAL_PENDING_SELECTORwhen entering IDLE, forcing the next call to trigger resolver/LB restart. - Prevent pending-call reprocessing when
updateConfigSelector()is called withINITIAL_PENDING_SELECTOR(only reprocess when transitioning away from the initial pending selector).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| shutdownNameResolverAndLoadBalancer(true); | ||
| delayedTransport.reprocess(null); | ||
| realChannel.updateConfigSelector(INITIAL_PENDING_SELECTOR); | ||
| channelLogger.log(ChannelLogLevel.INFO, "Entering IDLE state"); | ||
| channelStateManager.gotoState(IDLE); |
The tests are passing locally. Also the failures in tests(11) and tests(17) runs are unrelated to changes I made. And same tests passed in tests(8) and test(21). Also I don't see an option to retrigger the failed tests. |
|
Is it anything else I should do to get the change reviewed ? We face this issue occasionally in production and it requires a service restart to reset GRPC channel |
ManagedChannel will stuck in IDLE state when xDS control plane doesn't have a resource anymore.
The scenario is following: