Skip to content

Commit 080f6b0

Browse files
BrennaEpptritone
andauthored
fix(storage): retry url.Error and net.OpErrors when they wrap an io.EOF (#12289)
Co-authored-by: Chris Cotter <[email protected]>
1 parent c00965b commit 080f6b0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

storage/invoke.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ func ShouldRetry(err error) bool {
174174
// We don't want to retry io.EOF errors, since these can indicate normal
175175
// functioning terminations such as internally in the case of Reader and
176176
// externally in the case of iterator methods. However, the linked bug
177-
// requires us to retry EOFs that it causes. We can distinguish
178-
// EOFs caused by the bug because they are not wrapped correctly.
179-
if !errors.Is(err, io.EOF) && strings.Contains(err.Error(), "EOF") {
177+
// requires us to retry the EOFs that it causes, which should be wrapped
178+
// in net or url errors.
179+
if errors.Is(err, io.EOF) {
180180
return true
181181
}
182182
case *net.DNSError:

0 commit comments

Comments
 (0)