mirror of
https://github.com/Icinga/icingadb.git
synced 2026-06-08 16:34:29 -04:00
retry.Retryable(): treat ENOENT (AF_UNIX) like ECONNREFUSED, i.e. also 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.
This commit is contained in:
parent
4ed4db3ab6
commit
a3c1007d47
1 changed files with 2 additions and 2 deletions
|
|
@ -114,9 +114,9 @@ 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.
|
||||
// which do not include ECONNREFUSED or ENOENT, so we check these ourselves.
|
||||
return true
|
||||
}
|
||||
if errors.Is(err, syscall.ECONNRESET) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue