-
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
balancer: Enforce embedding requirement for balancer.ClientConn #8026
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8026 +/- ##
==========================================
+ Coverage 82.29% 82.34% +0.04%
==========================================
Files 388 387 -1
Lines 39028 39037 +9
==========================================
+ Hits 32120 32144 +24
+ Misses 5578 5567 -11
+ Partials 1330 1326 -4
|
For now, this is blocked on at least one dependency being updated. |
Merged a PR to avoid breakages in grpc-gcp-go: GoogleCloudPlatform/grpc-gcp-go#91 |
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.
Please make sure the GCP balancer changes have been released, updated in the google cloud client libraries repo & released there ( 😢 ), and imported before this is merged.
@@ -293,6 +294,7 @@ func (gsb *Balancer) Close() { | |||
// State updates from the wrapped balancer can result in invocation of the | |||
// graceful switch logic. | |||
type balancerWrapper struct { | |||
balancer.ClientConn |
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.
If we are embedding now, we can remove the Target
implementation.
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.
Removed.
Waiting on release of https://github.com/GoogleCloudPlatform/grpc-gcp-go. |
Similar to #7840, this PR ensures gRPC can add new methods to the ClientConn interface. This change prepares us for passing the metrics recorder to LB policies through the balancer.ClientConn interface instead of the
balancer.BuildOptions
as being done presently. Usingbalancer.BuildOptions
doesn't allow gRPC to ensure users are propagating the metrics recorder to child LB Policies and can lead to nil pointer dereferences at runtime.RELEASE NOTES:
balancer.ClientConn
interface to force implementors to embed a delegate implementation. This helps grpc-go add new methods to the interface without breaking builds for implementors of custom LB Policies.