From 8ece05255d21ca787acf89b8b69291a9e735386c Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Thu, 9 May 2024 12:34:48 +0200 Subject: [PATCH] Add request type to 'read from broker errored' log Signed-off-by: Marco Pracucci --- pkg/kgo/broker.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/kgo/broker.go b/pkg/kgo/broker.go index 368ad52c..c3d5a9a7 100644 --- a/pkg/kgo/broker.go +++ b/pkg/kgo/broker.go @@ -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} }