Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection errors are spamming #1020

Open
legau opened this issue Jun 27, 2024 · 1 comment
Open

Connection errors are spamming #1020

legau opened this issue Jun 27, 2024 · 1 comment

Comments

@legau
Copy link

legau commented Jun 27, 2024

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()
@Ben621
Copy link

Ben621 commented Jul 2, 2024

@legau Try to set api_version = "2.8.1"

e.g.

    async with AIOKafkaConsumer(
        "test",
        api_version= "2.8.1",
        bootstrap_servers="kafka:29092",
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants