From 75d8637117367cfd24ee6b3dd092110c9457a0f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Mon, 21 Oct 2024 10:56:51 +0200 Subject: [PATCH] Actually record last retry time after reconnecting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code was incorrectly setting it to "never", meaning the bodyReaderMSSinceLastRetry heuristic was never triggered, and, in effect, we would _always_ reconnect on io.ErrUnexpectedEOF or syscall.ECONNRESET . This corrects the code - but it might also make more network failures user-visible instead of silently retried. Signed-off-by: Miloslav Trmač --- docker/body_reader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/body_reader.go b/docker/body_reader.go index 29d3b0420e..e69e21ef7a 100644 --- a/docker/body_reader.go +++ b/docker/body_reader.go @@ -197,7 +197,7 @@ func (br *bodyReader) Read(p []byte) (int, error) { consumedBody = true br.body = res.Body br.lastRetryOffset = br.offset - br.lastRetryTime = time.Time{} + br.lastRetryTime = time.Now() return n, nil default: