kafka-python icon indicating copy to clipboard operation
kafka-python copied to clipboard

Propagate future.exception in producer/kafka.py _wait_on_metadata

Open mkromer-tc opened this issue 5 years ago • 3 comments

Propagate any exceptions that happened during the future; otherwise _wait_on_metadata will time out even though the error is being continuously reflected in the metadata status fetched from the broker. Issue #2078


This change is Reviewable

mkromer-tc avatar Jul 14 '20 15:07 mkromer-tc

Wouldn't this prevent retrying exceptions that are likely to be resolved within the timeout? Are there specific exceptions that you are concerned about here?

dpkp avatar Sep 07 '20 23:09 dpkp

Any permission issues are not transient. I was testing with locked down topics and even though the broker sent the error back the library ignored it. Also, any attempt to connect with a misconfigured authentication scheme (ssl, sasl, whatever) will also never correct itself.

It’s been a bit since I looked at it, but propagating the exception solved at least two issues I encountered during testing. Presumably the same issues could exist on the consumer side but I was only testing the producer side.

I guess if you really felt like it you could split the exceptions into transient and permanent exceptions and only propagate the permanent ones, but it seems like that would be most of them.

Sent from my iPad

On Sep 7, 2020, at 7:25 PM, Dana Powers [email protected] wrote:

 Wouldn't this prevent retrying exceptions that are likely to be resolved within the timeout? Are there specific exceptions that you are concerned about here?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

mkromer-tc avatar Sep 07 '20 23:09 mkromer-tc

It looks like the java client only raises on invalid or unauthorized topics, or on a connection authentication failure. Other failures are not raised and will get retried subject to the timeout.

dpkp avatar Sep 08 '20 00:09 dpkp