-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
grpclb: keep track of state updates for cached Subchannels. (#5441)
The problem: GrpclbState tracks Subchannels' states as a mutable attribute in Subchannel.getAttributes(). However, GrpclbState only update this attribute for the Subchannels its managing. For those cached in SubchannelPool, their state attributes are stale. When they are given back to GrpclbState, IDLE state is assumed. As a result, if a Subchannel is READY when it's reclaimed from the pool, it will not be picked. To fix that, this change expands SubchannelPool interface to handle Subchannel state updates, which GrpclbState will call. SubchannelPool saves the latest state and delivers it when it's returned to GrpclbState by scheduling a call to handleSubchannelState() in the SynchronizationContext, so that GrpclbState will take the latest state as if it was just reported from the Channel.
- Loading branch information
1 parent
6b0325c
commit 034675e
Showing
6 changed files
with
176 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.