Skip to content

Commit

Permalink
retry.Retryable(): treat ENOENT (AF_UNIX) like ECONNREFUSED, i.e. als…
Browse files Browse the repository at this point in the history
…o retry

During connect(2) we may get ECONNREFUSED between server's bind(2) and
listen(2), but the most downtime between boot and service start the socket
won't exist, yet. I.e. ENOENT is the de facto ECONNREFUSED of *nix sockets.
  • Loading branch information
Al2Klimov committed May 22, 2023
1 parent 4ed4db3 commit a73e398
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/retry/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func Retryable(err error) bool {
// which is not considered temporary or timed out by Go.
err = opError.Err
}
if errors.Is(err, syscall.ECONNREFUSED) {
if errors.Is(err, syscall.ECONNREFUSED) || errors.Is(err, syscall.ENOENT) {
// syscall errors provide Temporary() and Timeout(),
// which do not include ECONNREFUSED, so we check this ourselves.
return true
Expand Down

0 comments on commit a73e398

Please sign in to comment.