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: initialize safe config selector when creating ClientConn #4398

Merged
merged 1 commit into from May 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions clientconn.go
Expand Up @@ -143,6 +143,7 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
firstResolveEvent: grpcsync.NewEvent(),
}
cc.retryThrottler.Store((*retryThrottler)(nil))
cc.safeConfigSelector.UpdateConfigSelector(&defaultConfigSelector{nil})
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems #4343 can reproduce this bug ~reliably.
Did you look more into that and figure out how it happened?
Maybe we can make a test case from it.

Copy link
Member Author

@dfawley dfawley May 7, 2021

Choose a reason for hiding this comment

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

The logs from #4343 are how I figured out what's happening here. What's happening there is the resolver is reporting an error while the clientconn is being shut down. It seems hard to stimulate it reliably since: 1. the window is very small between steps 3-4, and 2. even if you hit it the odds of (6) happening also seems low.

cc.ctx, cc.cancel = context.WithCancel(context.Background())

for _, opt := range opts {
Expand Down