Skip to content

Commit

Permalink
io.EOF: make a retriable broker error
Browse files Browse the repository at this point in the history
Sooner or later, all retriable broker errors will be stamped out.
  • Loading branch information
twmb committed Aug 20, 2021
1 parent 370c18e commit 589c5e5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/kgo/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"io"
"net"
"os"
)
Expand Down Expand Up @@ -39,6 +40,12 @@ func isRetriableBrokerErr(err error) bool {
if errors.As(err, &tempErr) {
return tempErr.Temporary()
}

// EOF can be returned if a broker kills a connection unexpectedly, and
// we can retry that.
if errors.Is(err, io.EOF) {
return true
}
switch err {
case errChosenBrokerDead,
errCorrelationIDMismatch:
Expand Down

0 comments on commit 589c5e5

Please sign in to comment.