-
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/weightedroundrobin: Switch Weighted Round Robin to use pick first instead of SubConns #7826
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7826 +/- ##
==========================================
- Coverage 81.84% 81.82% -0.03%
==========================================
Files 373 375 +2
Lines 37845 37984 +139
==========================================
+ Hits 30976 31082 +106
- Misses 5578 5590 +12
- Partials 1291 1312 +21
|
LGTM modulo the one issue mentioned above. |
Got to the two points we discussed in our 1:1. |
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.
Two minor requests, otherwise LGTM. Thanks!
if err != nil { | ||
return nil, err | ||
} | ||
b.scToWeight[sc] = ewi.(*endpointWeight) | ||
return sc, err |
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.
nil
explicitly, please, since you asserted err == nil
already.
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.
Ah, done.
@@ -463,7 +467,7 @@ func (p *picker) regenerateScheduler() { | |||
atomic.StorePointer(&p.scheduler, unsafe.Pointer(&s)) | |||
} | |||
|
|||
func (p *picker) start(ctx context.Context) { | |||
func (p *picker) start(done *grpcsync.Event) { |
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.
stopPicker
so the name is consistent?
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.
Done.
This PR switches weighted round robin to defer to pick first instead of creating and handling SubConns itself. This is part of DualStack, and makes this a petiole.
RELEASE NOTES: