-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add more generic error predicates #3116
Add more generic error predicates #3116
Conversation
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 1 file changed, 28 insertions(+), 4 deletions(-)) |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 1 file changed, 32 insertions(+), 4 deletions(-)) |
reviewers - I think it's not a bad idea to add the Temporary check, but since we don't currently do this, I'm also fine removing it for now. |
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'm just curious what would implement temporary. Is that a standard thing for temporary errors to implement, and if it is, can we link to docs or something on it from our interface?
if urlerr, ok := err.(*url.Error); ok && urlerr.Timeout() { | ||
log.Printf("[DEBUG] Dismissed an error as retryable based on googleapis.com target: %s", err) | ||
type temporary interface { | ||
Temporary() bool |
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.
Does anything implement this right now?
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.
yup - url.Error and net.OpError - I actually noticed that some of the Go client libraries did this (like googleapis/google-cloud-go@8007d26)
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.
Thanks! Mind commenting and linking to an example of an implementer?
Also, I think we actually want to call Temporary()
, right? Since they'll return false
for non-temporary errors based on https://golang.org/src/net/net.go?s=13212:13333#L384
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 realized right after and pushed an update ha
return false, "" | ||
} | ||
|
||
func isRetryableUrlError(err error) (bool, string) { |
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.
(non-blocking) I have a slight preference for implementing this as many smaller predicates, but it isn't too strongly held.
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.
:+1 am fine with that too. Thoughts on retrying on all net.OpErrors in general?
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'm curious what the actual errors returned by that package end up looking like, if you think it would work I'm 👍. At the very least, errors for whom Temporary()
and Timeout()
return true
make sense based on https://golang.org/src/net/net.go?s=13212:13333#L384.
526c8ee
to
eed5d3e
Compare
if urlerr, ok := err.(*url.Error); ok && urlerr.Timeout() { | ||
log.Printf("[DEBUG] Dismissed an error as retryable based on googleapis.com target: %s", err) | ||
type temporary interface { | ||
Temporary() bool |
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.
Thanks! Mind commenting and linking to an example of an implementer?
Also, I think we actually want to call Temporary()
, right? Since they'll return false
for non-temporary errors based on https://golang.org/src/net/net.go?s=13212:13333#L384
return false, "" | ||
} | ||
|
||
func isRetryableUrlError(err error) (bool, string) { |
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'm curious what the actual errors returned by that package end up looking like, if you think it would work I'm 👍. At the very least, errors for whom Temporary()
and Timeout()
return true
make sense based on https://golang.org/src/net/net.go?s=13212:13333#L384.
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 1 file changed, 43 insertions(+), 1 deletion(-)) |
1 similar comment
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 1 file changed, 43 insertions(+), 1 deletion(-)) |
cd13777
to
f0b7d22
Compare
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 1 file changed, 57 insertions(+), 6 deletions(-)) |
1 similar comment
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 1 file changed, 57 insertions(+), 6 deletions(-)) |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 1 file changed, 56 insertions(+), 6 deletions(-)) |
* add connection reset by peer predicate * lint * separate error preds, fix temp pred * Fix error retries, comments * remove removed func
Fixes hashicorp/terraform-provider-google#3957
Release Note Template for Downstream PRs (will be copied)