aiokafka
aiokafka copied to clipboard
Connection errors are spamming
Describe the bug Whenever AIOKafkaConsumer (maybe Producer too) loses connection to Kafka, 17 identical error logs are outputted.
Failed fetch messages from 1: NodeNotReadyError: Attempt to send a request to node which is not ready (node id 1).
Unable connect to node with id 1: [Errno 111] Connect call failed ('172.19.0.8', 29092)
Unable to update metadata from [1]
Expected behaviour Only 1 log
Environment (please complete the following information):
- aiokafka version: 0.10.0
- Kafka Broker version: 7.6.1-ccs
Reproducible example
from aiokafka import AIOKafkaConsumer
async def run_consumer():
async with AIOKafkaConsumer(
"test",
bootstrap_servers="kafka:29092",
) as consumer:
async for message in consumer:
print(message.value)
if __name__ == "__main__":
import asyncio
loop = asyncio.get_event_loop()
loop.run_until_complete(run_consumer())
loop.close()