Skip to content

Conversation

@ejona86
Copy link
Member

@ejona86 ejona86 commented Mar 6, 2025

ffcc360 adjusted updateBalancingState() to require being run within the sync context. However, it still queued the work into the sync context, which was unnecessary. This re-entering the sync context unnecessarily delays the new state from being used.


I found this with a new xds test I've prepared, after fixing some problems in xds name resolver. See master...ejona86:grpc-java:xds-cluster-race (which I'll send out once this is merged). After fixing XdsNameResolver, the test went from failing 2% to ~0.2% of the time. That led me to discover this delayed processing. With both changes, there were no flakes in 1000 runs.

CC @kannanjgithub, @danielzhaotongliu

ffcc360 adjusted updateBalancingState() to require being run within
the sync context. However, it still queued the work into the sync
context, which was unnecessary. This re-entering the sync context
unnecessarily delays the new state from being used.
@ejona86 ejona86 requested a review from larry-safran March 6, 2025 16:26
@ejona86 ejona86 merged commit ca4819a into grpc:master Mar 6, 2025
16 checks passed
@ejona86 ejona86 deleted the core-updateBalancingState-immediate branch March 6, 2025 20:31
Copy link
Collaborator

@danielzhaotongliu danielzhaotongliu left a comment

Choose a reason for hiding this comment

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

LGTM.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants