-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
grpclb: split grpclb out of top level grpc package #2107
Conversation
@menghanl PTAL There is now a fake grpclb used in the top level test. Also, There is still some followup items (like docs), but I can do those in a followup PR. This one is getting too big. |
Thanks a lot for this change! Some nits/minor comments. Review status: all files reviewed at latest revision, all discussions resolved. balancer_switching_test.go, line 392 at r2 (raw file):
Delete this function? balancer_v1_wrapper.go, line 83 at r2 (raw file):
Nit: move these three lines below balancer/balancer.go, line 230 at r2 (raw file):
How about renaming this to ConnectivityStateEvaluator? And update the comment?
balancer/balancer.go, line 239 at r2 (raw file):
Also on comments, how about this:
internal/internal.go, line 31 at r2 (raw file):
Merge all three into one And comment that those two are only used by grpclb? balancer/grpclb/grpclb_test.go, line 475 at r2 (raw file):
How about creating a new ctx with 2 seconds timeout before entering the loop? balancer/grpclb/grpclb_test.go, line 484 at r2 (raw file):
Why is this check necessary? Comments from Reviewable |
Reviewable is asking for overly broad permissions so comments here:
I had at one point, but it needs a second cancel function, and the deadline is already encompassed by the prior one. If the call hangs (as it did in my testing) this could take 1000 * 2 seconds to complete, which is too long.
Because if the RPC hangs, the context will be done, but the iterator will not be 1000. All other comments are "done" |
Review status: 12 of 13 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. balancer_v1_wrapper.go, line 91 at r4 (raw file):
Nit: to show mu also covers the following fields, I would remove this blank line. Comments from Reviewable |
Thanks for the fixes. Sorry I merged another grpclb PR #2101 that caused conflicts. Three conflicts if I didn't miss anything:
|
@menghanl done! PTAL |
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.
Thanks a lot! LGTM.
This PR splits out grpclb from grpc. I have made the PR in several commits so you can see more clearly the steps that happened.
There are a few possibly contentious points that I would like to make clear up front:
internal
is used more, as a way of having code shared between packages without exposing typesAll but one tests pass with this, due to another cyclic dependency. I can fix this, but it is a little more widely scoped (such as exposing grpc.server and grpc.errorDesc in the internal package). This PR is a nearly-passing sample of that last step to get this working.
PTAL @menghanl @dfawley