aiokafka
aiokafka copied to clipboard
catch "NodeNotReadyError" exception while consuming from Kafka
Hey can we catch "NodeNotReadyError" exception while consuming from Kafka . So that we can take any action at this situation. Like sending alert.
At the moment there is no way to catch connection errors, sorry. What situation in particular are you interested in? When some node disconnects or is not reachable for some amount of time, or all nodes are not available?
@tvoinarovskyi can it automatically connect with other active nodes when few nodes are down? Our system just hangs when one node is down.
@ja8zyjits It should, the system is meant to run on cluster systems with automatic reconnect on node failure. Could you open a bug issue with more detail on what scenario are you seeing? There seems to be one issue https://github.com/aio-libs/aiokafka/issues/625, that also has symptoms of stopping, maybe it may be related.
@tvoinarovskyi sorry, not able to reproduce. It happens rarely and the system just hangs. will report a new bug once we are able to reproduce the issue properly.
If you have two containers one kafka
and another one with the aiokafkaconsumer
if you restart kafka or kafka crashes the aiokafkaconsumer
will hang for a long time. However, if I just restart the aiokafkaconsumer everything will work fine.
I tried a lot of different approaches, setting lower times for the session, consumer and other things but none of them worked. It would be really useful if we had an option in the aiokafkaconsumer to forward the exception when they occur Because from this example I could just end the consumer and recreate it
Anyone able to fix the issue yet"?
Still having the issue.