Skip to content

Commit

Permalink
Merge pull request #723 from pracucci/enrich-read-from-broker-error-log
Browse files Browse the repository at this point in the history
Add request type to 'read from broker errored' log
  • Loading branch information
twmb authored May 26, 2024
2 parents 1799ea5 + 8ece052 commit 67f45f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/kgo/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1463,9 +1463,9 @@ func (cxn *brokerCxn) handleResp(pr promisedResp) {
if err != nil {
if !errors.Is(err, ErrClientClosed) && !errors.Is(err, context.Canceled) {
if cxn.successes > 0 || len(cxn.b.cl.cfg.sasls) > 0 {
cxn.b.cl.cfg.logger.Log(LogLevelDebug, "read from broker errored, killing connection", "addr", cxn.b.addr, "broker", logID(cxn.b.meta.NodeID), "successful_reads", cxn.successes, "err", err)
cxn.b.cl.cfg.logger.Log(LogLevelDebug, "read from broker errored, killing connection", "req", kmsg.Key(pr.resp.Key()).Name(), "addr", cxn.b.addr, "broker", logID(cxn.b.meta.NodeID), "successful_reads", cxn.successes, "err", err)
} else {
cxn.b.cl.cfg.logger.Log(LogLevelWarn, "read from broker errored, killing connection after 0 successful responses (is SASL missing?)", "addr", cxn.b.addr, "broker", logID(cxn.b.meta.NodeID), "err", err)
cxn.b.cl.cfg.logger.Log(LogLevelWarn, "read from broker errored, killing connection after 0 successful responses (is SASL missing?)", "req", kmsg.Key(pr.resp.Key()).Name(), "addr", cxn.b.addr, "broker", logID(cxn.b.meta.NodeID), "err", err)
if err == io.EOF { // specifically avoid checking errors.Is to ensure this is not already wrapped
err = &ErrFirstReadEOF{kind: firstReadSASL, err: err}
}
Expand Down

0 comments on commit 67f45f3

Please sign in to comment.