Skip to content

Kafka does not react to connection issues #1351

Closed
@tonyqui

Description

@tonyqui

Hello folks,
It looks like Kafka behaves quite badly when a DNS service is used to bootstrap a KafkaClient (imagine to have a symbolic host-name that binds into multiple IP addresses).
In this specific case, Kafka will resolve the host to one IP address through the nslookup process.
If the resolved IP becomes unreachable, Kafka logs over and over that a connection cannot be established towards the remote system.
Since a connection issue [identified by "Connect attempt to XXX returned error YYY] does not raise any exception, we cannot identify when a KafkaClient must be deleted and created from scratch (or eventually it would be feasible as well to have Kafka resolving again the DNS entry - that in my case it won't contain anymore the unreachable host).

What does the community think about creating an optional client (client_asynch) that eventually can raise exception if a connection is not established after a given amount of retries?

And what about changing the way Kafka works by forcing always a name resolution when a hostname is used to bootstrap the Client (to be confirmed if the KafkaClient is to be meant as an abstraction of a socket object - meaning that it should be always the same to keep a connection always opened).

Thank you for the attention,
Regards,
Antonio

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions