Skip to content
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

client: block RPCs early until the resolver has returned addresses #2409

Merged
merged 4 commits into from
Nov 9, 2018

Conversation

dfawley
Copy link
Member

@dfawley dfawley commented Oct 29, 2018

This allows the initial RPC(s) an opportunity to apply settings from the service config; without this change we would still block, but only after observing the current service config settings.

@dfawley dfawley added this to the 1.17 Release milestone Oct 29, 2018
@dfawley dfawley requested a review from menghanl November 1, 2018 20:09
clientconn.go Outdated
@@ -402,6 +403,10 @@ type ClientConn struct {
balancerWrapper *ccBalancerWrapper
retryThrottler atomic.Value

resolvedAddrsOnce sync.Once
resolvedAddrs chan struct{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: rename this field? This sounds like a []Address to me.

@dfawley
Copy link
Member Author

dfawley commented Nov 7, 2018

Updated to use a grpcsync.Event instead of manually doing all the things it already does. Made grpcsync.Event use an atomic in the fast-path for performance. PTAL.

clientconn.go Outdated
@@ -402,6 +404,8 @@ type ClientConn struct {
balancerWrapper *ccBalancerWrapper
retryThrottler atomic.Value

resolvedOnce *grpcsync.Event
Copy link
Contributor

Choose a reason for hiding this comment

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

The name... This looks like a sync.Once...
How about resolvedEvent?

Copy link
Member Author

Choose a reason for hiding this comment

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

firstResolveEvent?

@dfawley dfawley merged commit a612bb6 into grpc:master Nov 9, 2018
@dfawley dfawley deleted the wait_for_resolver branch December 6, 2018 22:08
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants