Skip to content

fix(pick_first): ignore state updates from shut down or replaced subchannels - #12968

Draft
AgraVator wants to merge 1 commit into
grpc:masterfrom
AgraVator:fix-pickfirst-stale-subchannel
Draft

fix(pick_first): ignore state updates from shut down or replaced subchannels#12968
AgraVator wants to merge 1 commit into
grpc:masterfrom
AgraVator:fix-pickfirst-stale-subchannel

Conversation

@AgraVator

Copy link
Copy Markdown
Contributor

In legacy PickFirstLoadBalancer, when handleNameResolutionError() or shutdown() is called, subchannel.shutdown() is invoked. Because ManagedChannelImpl delays subchannel shutdown by 5 seconds (SUBCHANNEL_SHUTDOWN_DELAY_SECONDS), the old subchannel may complete a connection attempt during this window and fire READY state updates. Without a check verifying if the calling subchannel is still the current active subchannel, PickFirstLoadBalancer publishes a READY picker for the obsolete subchannel right before its 5-second delayed shutdown task fires and kills the transport. This leaves the channel permanently stuck in READY with a dead subchannel picker.

Fixes #12958

…hannels

In legacy PickFirstLoadBalancer, when handleNameResolutionError() or shutdown() is called, subchannel.shutdown() is invoked.
Because ManagedChannelImpl delays subchannel shutdown by 5 seconds (SUBCHANNEL_SHUTDOWN_DELAY_SECONDS), the old subchannel may complete a connection attempt during this window and fire READY state updates.
Without a check verifying if the calling subchannel is still the current active subchannel, PickFirstLoadBalancer publishes a READY picker for the obsolete subchannel right before its 5-second delayed shutdown task fires and kills the transport. This leaves the channel permanently stuck in READY with a dead subchannel picker.

Fixes grpc#12958

@kannanjgithub kannanjgithub left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than say 'Fixes #12958' in the PR description, say 'Partially addresses #12958'. Lets keep the issue open to still look into the new PF problem mentioned in the issue also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants