Retry ECONNRESET

ECONNRESET is treated as a temporary error by Go only if it comes from
calling accept.
This commit is contained in:
Eric Lippmann 2022-06-28 19:58:02 +02:00
parent 6a5db1ca94
commit 444332a682

View file

@ -118,6 +118,10 @@ func Retryable(err error) bool {
// which do not include ECONNREFUSED, so we check this ourselves.
return true
}
if errors.Is(err, syscall.ECONNRESET) {
// ECONNRESET is treated as a temporary error by Go only if it comes from calling accept.
return true
}
return false
}