From d623ffe71b2fda1548e14b1214ab1ccfeeae4f24 Mon Sep 17 00:00:00 2001 From: Travis Bischel Date: Mon, 11 Oct 2021 00:27:10 -0600 Subject: [PATCH] errors: make errProducerIDLoadFail retriable When a producer id load fails with a retriable error, we swallow the error and instead return errProducerIDLoadFail. This gets used when bumping repeated load failures on partitions, and since this internal error does not look retriable, we fail records. We now make this a retriable broker error (since it is), which allows the producer ID load to fail and be retried. --- pkg/kgo/errors.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/kgo/errors.go b/pkg/kgo/errors.go index c3b77c9b..da349069 100644 --- a/pkg/kgo/errors.go +++ b/pkg/kgo/errors.go @@ -51,6 +51,11 @@ func isRetriableBrokerErr(err error) bool { if isNetClosedErr(err) || errors.Is(err, io.EOF) { return true } + // We could have a retriable producer ID failure, which then bubbled up + // as errProducerIDLoadFail so as to be retried later. + if errors.Is(err, errProducerIDLoadFail) { + return true + } // We could have chosen a broker, and then a concurrent metadata update // could have removed it. if errors.Is(err, errChosenBrokerDead) {