-
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
resolver/manual: support restarts, required for channel idleness #6638
resolver/manual: support restarts, required for channel idleness #6638
Conversation
resolver/manual/manual.go
Outdated
r.UpdateState(*r.bootstrapState) | ||
if r.lastSeenState != nil { | ||
err := r.CC.UpdateState(*r.lastSeenState) | ||
go func(err error) { r.UpdateStateCallback(err) }(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.
What's the concern about using go r.UpdateStateCallback(err)
? err
can't be modified after this.
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.
I think I was paranoid beyond repair :P
resolver/manual/manual.go
Outdated
@@ -26,7 +26,7 @@ import ( | |||
"google.golang.org/grpc/resolver" | |||
) | |||
|
|||
// NewBuilderWithScheme creates a new test resolver builder with the given scheme. | |||
// NewBuilderWithScheme creates a new manual resolver builder with the given scheme. |
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.
Should we document that this may only be used with a single ClientConn
? Otherwise bad things happen.
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.
// NewBuilderWithScheme creates a new manual resolver builder with the given scheme. | ||
// NewBuilderWithScheme creates a new manual resolver builder with the given | ||
// scheme. Every instance of the manual resolver may only ever be used with a | ||
// single grpc.ClientConn. Otherwise, bad things will happen. |
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.
LMAO.
RELEASE NOTES: none