From 444332a682f50619daef619b00c8248dfb4464ef Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 28 Jun 2022 19:58:02 +0200 Subject: [PATCH] Retry ECONNRESET ECONNRESET is treated as a temporary error by Go only if it comes from calling accept. --- pkg/retry/retry.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/retry/retry.go b/pkg/retry/retry.go index 509d1263..4c0d25d8 100644 --- a/pkg/retry/retry.go +++ b/pkg/retry/retry.go @@ -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 }