-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
balancer: fix logic to prevent producer streams before READY is reported #7651
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7651 +/- ##
==========================================
+ Coverage 81.89% 81.94% +0.04%
==========================================
Files 361 361
Lines 27818 27821 +3
==========================================
+ Hits 22782 22798 +16
+ Misses 3847 3837 -10
+ Partials 1189 1186 -3
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Couple of question:
|
Are you thinking this might be happening somewhere? Generally, delivering events out of order would probably cause problems (another reason to prefer state-based updates? 😄). Delaying some events will cause things to be reordered, so we'd need to be really careful about this.
I'm not sure how we could even synchronize this, unless literally everything is done in one serializer, including the producer receiving from its stream. Consider:
I think the only way to keep things perfectly in sync would rely on the producer itself running inside the LB policy's serializer, which would require an API change for the producer. Maybe we need to think more about this long-term. |
Fixes #7648 and #7507
The problem here was that the producer stream could attempt to start immediately after the channel went ready, but before ready was reported. The fix is to simply wait on the
stateReadyChan
even if the state isReady
at the start, which will proceed immediately if it's already closed. However, doing this requires some minor changes to managing the channel (only re-create when enteringReady
and close when shutting down) and some test tweaks.RELEASE NOTES: none