We are running python Kafka producer clients in a serverless environment (AWS Lambda python3.8 runtime) whereby (as per recommended best practices) we are sharing long-lived producer connections across invocations. We use a producer configuration similar to the following:
The errors appear to be associated with producer connections that we have yet to utilise for sending messages (we conditionally send messages upon invocation). In other words we have instantiated the producer = kafka.KafkaProducer object but are yet to call producer.send(...). We see this error message approximately 10 minutes after instantiating the producer which aligns with the Kafka broker cluster connections.max.idle.ms configuration of 600000 (i.e. 10 minutes).
Increasing the verbosity of logging does not seem to provide any further insight beyond the aforementioned error log message.
We are running python Kafka producer clients in a serverless environment (AWS Lambda python3.8 runtime) whereby (as per recommended best practices) we are sharing long-lived producer connections across invocations. We use a producer configuration similar to the following:
Everything is working as expected with the exception that every so often we see a number of errors similar to the following:
The errors appear to be associated with producer connections that we have yet to utilise for sending messages (we conditionally send messages upon invocation). In other words we have instantiated the
producer = kafka.KafkaProducer
object but are yet to callproducer.send(...)
. We see this error message approximately 10 minutes after instantiating the producer which aligns with the Kafka broker clusterconnections.max.idle.ms
configuration of 600000 (i.e. 10 minutes). Increasing the verbosity of logging does not seem to provide any further insight beyond the aforementioned error log message.It was my understanding is that the IdleConnectionManager (https://github.com/dpkp/kafka-python/blob/f0a57a6a20a3049dc43fbf7ad9eab9635bd2c0b0/kafka/client_async.py#L974) was responsible for the client-side handling of the situation where broker connections were deemed idle to prevent such server-side disconnections from happening. Is my understanding correct here or is this an issue with the Kafka python client implementation?