Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.1.0
-
None
-
None
-
None
-
Clean Docker environment, very simple everything single node.
Description
Steps to reproduce:
- Start single Zookeeper instance.
- Start single Kafka instance.
- Validate that the line
INFO [KafkaServer id=0] started (kafka.server.KafkaServer)
is printed.
- Connect using a Kafka client with debug logging enabled, right after seeing that line, do not wait.
- Observe that it is connected to the Kafka broker just fine, but that the broker lists an empty lists of nodes:
Updating cluster metadata to Cluster(id = xxx, nodes = [], [...]
- Keep watching for about 30 seconds, seeing that log entry popping up hundreds of times on the client. Nothing happens in Kafka/Zookeeper logs in the meantime, but then suddenly the Kafka server start reporting nodes to the connected client:
[...] nodes = [kafka:9092 (id: 0 rack: null)], [...] o.apache.kafka.clients.NetworkClient - [AdminClient clientId=adminclient-1] Initiating connection to node [...]
and it connects all fine.
My expectation is that it should list itself rightaway after listening on the network as a broker. It should not take ~ 30 seconds for a Kafka client to be blocked waiting and timing out first.
Use case: I'm trying to create topics in a CI/CD pipeline and spinning up a clean Kafka for that. Right after it's started, it should be possible to create topics using an AdminClient, but currently experiencing TimeoutException: Timed out waiting for a node assignment errors unless I put a sleep 30 between observing a Kafka reportedly ready and starting the topic creation process. Not very ideal.