Skip to content

Commit

Permalink
NXDOMAIN errors should not be retried (#2083)
Browse files Browse the repository at this point in the history
The standard retryer keeps retrying domains that do not resolve. This
hangs the execution until retries are exhausted.
NXDOMAIN or 'no such host' errors are not transient and should fail immediately.
An example would be when a user enters an invalid region that doesn't resolve.
  • Loading branch information
rem7 authored Apr 7, 2023
1 parent 439f88c commit d40a16e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aws/retry/retryable_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,13 @@ func (r RetryableConnectionError) IsErrorRetryable(err error) aws.Ternary {
var timeoutErr interface{ Timeout() bool }
var urlErr *url.Error
var netOpErr *net.OpError
var dnsError *net.DNSError

switch {
case errors.As(err, &dnsError):
// NXDOMAIN errors should not be retried
retryable = !dnsError.IsNotFound && dnsError.IsTemporary

case errors.As(err, &conErr) && conErr.ConnectionError():
retryable = true

Expand Down

0 comments on commit d40a16e

Please sign in to comment.