-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Automated cherry pick of #13224 #14572 #14573
Conversation
If one of the nodes in the cluster has lost a dns record, restarting the second node will break it. This PR makes an attempt to add a comparison without using a resolver, which allows to protect cluster from dns errors and does not break the current logic of comparing urls in the URLStringsEqual function. You can read more in the issue etcd-io#7798 Fixes etcd-io#7798 Signed-off-by: Prasad Chandrasekaran <[email protected]>
Co-authored-by: Lili Cosic <[email protected]> Signed-off-by: Prasad Chandrasekaran <[email protected]>
Signed-off-by: Prasad Chandrasekaran <[email protected]>
for _, str := range us { | ||
u, err := url.Parse(str) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to parse string to URL: %q", str) |
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.
It would be better to get the err included as well.
return nil, fmt.Errorf("failed to parse string to URL: %q", str) | |
return nil, fmt.Errorf("failed to parse string to URL: %q, %w", str, err) |
Since you are just backporting the PR, so please feel free to resolve this in a separate PR.
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 will create separate PR to fix 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.
LGTM
Thank you @pchan
Cherry pick of #13224 on release-3.5.
#13224: netutil: add url comparison without resolver to