Skip to content

Commit

Permalink
Actually record last retry time after reconnecting
Browse files Browse the repository at this point in the history
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č <[email protected]>
  • Loading branch information
mtrmac committed Oct 23, 2024
1 parent 75bad95 commit 6516e7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker/body_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6516e7e

Please sign in to comment.