aiokafka icon indicating copy to clipboard operation
aiokafka copied to clipboard

catch "NodeNotReadyError" exception while consuming from Kafka

Open arvindjangra1996 opened this issue 4 years ago • 7 comments

Hey can we catch "NodeNotReadyError" exception while consuming from Kafka . So that we can take any action at this situation. Like sending alert.

arvindjangra1996 avatar May 13 '20 06:05 arvindjangra1996

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 avatar May 15 '20 11:05 tvoinarovskyi

@tvoinarovskyi can it automatically connect with other active nodes when few nodes are down? Our system just hangs when one node is down.

ja8zyjits avatar Jun 11 '20 21:06 ja8zyjits

@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 avatar Jun 12 '20 12:06 tvoinarovskyi

@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.

ja8zyjits avatar Jun 18 '20 06:06 ja8zyjits

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

marcelotrevisani avatar Jun 16 '21 08:06 marcelotrevisani

Anyone able to fix the issue yet"?

sam-orca avatar Jul 26 '22 21:07 sam-orca

Still having the issue.

elina-israyelyan avatar Sep 30 '22 14:09 elina-israyelyan