aiokafka icon indicating copy to clipboard operation
aiokafka copied to clipboard

Consumers start hanging with AIOKafkaConnection._read() Cancelled Error

Open vineetgoel opened this issue 6 years ago • 16 comments

The consumers start hanging at some point with the following error being logged:

[2017-11-07 18:17:47,547: ERROR] Task exception was never retrieved
future: <Task finished coro=<AIOKafkaConnection._read() done, defined at /home/foo/env/lib/python3.6/site-packages/aiokafka/conn.py:194> exception=CancelledError()>

What might be causing the error? Should we be crashing the consumer upon getting the error?

This is with aiokafka==0.3.1

vineetgoel avatar Nov 08 '17 03:11 vineetgoel

I confirmed that this isn't making the consumer hang and is not really having any adverse effects. However, we should be handling these exceptions better.

vineetgoel avatar Nov 20 '17 22:11 vineetgoel

Any updates on this?

I repeatedly keep getting these errors, don't think it is fatal though.

vineetgoel avatar Nov 30 '17 22:11 vineetgoel

Could you describe how you use the consumer? The error seems strange, it's like you close the consumer the same moment it connects... It is probably not critical, but I still fail to understand when it fails.

tvoinarovskyi avatar Dec 01 '17 05:12 tvoinarovskyi

I am not closing the consumer. This happens while the consumer is idle for sometime waiting for messages on certain partitions.

vineetgoel avatar Dec 01 '17 19:12 vineetgoel

Ohh, this is probably a fail on idle connection closure. The connection is closed if not active for some time, probably this log is a side effect there. Will investigate, thank

tvoinarovskyi avatar Jan 22 '18 13:01 tvoinarovskyi

I have the same problem. After 10 minutes of idle connection.

vsel avatar Jan 25 '18 10:01 vsel

Ignore it, it's a bug, but should have no impact on operability

tvoinarovskyi avatar Jan 25 '18 10:01 tvoinarovskyi

OK. Thank you. I was confused because I just produce data and read nothing.

vsel avatar Jan 25 '18 15:01 vsel

@vsel Sorry, but I still have problems reproducing this. Could you provide your Producer configuration and if possible the script, that can reproduce the issue.

tvoinarovskyi avatar Jan 28 '18 13:01 tvoinarovskyi

Ok, this is not the idle thing... The connections_max_idle_ms config did not work at all =)

tvoinarovskyi avatar Jan 28 '18 14:01 tvoinarovskyi

Indeed! Do you still need my configuration for reproducing the issue? P.S. Sorry for delay.

vsel avatar Jan 29 '18 13:01 vsel

Yes, please. Want to track it down

tvoinarovskyi avatar Jan 29 '18 14:01 tvoinarovskyi

I can’t reproduce this bug with virtual kafka environment, so I’ll try to chat about this issue with devOps colleagues. I’m sorry. May be I can check something on production environment?

vsel avatar Feb 03 '18 11:02 vsel

This should be fixed as of 0.4.0, but will leave open until someone can confirm it.

tvoinarovskyi avatar Feb 06 '18 15:02 tvoinarovskyi

I haven't ran into this issue using aiokafka==0.4.0

bt-wil avatar Mar 15 '18 00:03 bt-wil

I'm still getting this errors with version 0.4.0. Don't think that it impacts anything but still..

myaspm avatar Jun 20 '18 08:06 myaspm