You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kgo: mark ErrFirstReadEOF non-retryable after 3 tries
On very busy systems, it is possible for connections to be cut
immediately after opening even if things are otherwise healthy and tls
and sasl are configured properly. We now track EOF errors happening 3x
in a row (on a given connection type), and only at that point mark the
error as non-retryable.
This looks a bit weird with the deferred track closure, but doing it
like this ensures we reset the EOF count on any success state.
Updates b2620e2.
if!errors.Is(err, ErrClientClosed) &&!errors.Is(err, context.Canceled) &&!strings.Contains(err.Error(), "operation was canceled") {
697
705
iferrors.Is(err, io.EOF) {
698
706
b.cl.cfg.logger.Log(LogLevelWarn, "unable to open connection to broker due to an immediate EOF, which often means the client is using TLS when the broker is not expecting it (is TLS misconfigured?)", "addr", b.addr, "broker", logID(b.meta.NodeID), "err", err)
b.cl.cfg.logger.Log(LogLevelWarn, "unable to open connection to broker", "addr", b.addr, "broker", logID(b.meta.NodeID), "err", err)
702
710
}
@@ -732,6 +740,7 @@ type brokerCxn struct {
732
740
reading atomic.Bool
733
741
734
742
successesuint64
743
+
incEOFfunc(bool) bool
735
744
736
745
// resps manages reading kafka responses.
737
746
respsring[promisedResp]
@@ -807,7 +816,7 @@ start:
807
816
return&errApiVersionsReset{err}
808
817
} elseiferrors.Is(err, io.EOF) {
809
818
cxn.b.cl.cfg.logger.Log(LogLevelWarn, "read from broker received EOF during api versions discovery, which often happens when the broker requires TLS and the client is not using it (is TLS misconfigured?)", "addr", cxn.b.addr, "broker", logID(cxn.b.meta.NodeID), "err", err)
0 commit comments