Details
Description
If Consumer started with wrong bootstrap servers or absent any valid servers, and Thread call Consumer.poll(timeout) with any timeout Thread stuck in loop with debug logs like
org.apache.kafka.common.network.Selector - Connection with /172.31.1.100 disconnected java.net.ConnectException: Connection timed out: no further information at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.apache.kafka.common.network.PlaintextTransportLayer.finishConnect(PlaintextTransportLayer.java:51) at org.apache.kafka.common.network.KafkaChannel.finishConnect(KafkaChannel.java:81) at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:335) at org.apache.kafka.common.network.Selector.poll(Selector.java:303) at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:349) at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:226) at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:203) at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.awaitMetadataUpdate(ConsumerNetworkClient.java:138) at org.apache.kafka.clients.consumer.internals.AbstractCoordinator.ensureCoordinatorReady(AbstractCoordinator.java:216) at org.apache.kafka.clients.consumer.internals.AbstractCoordinator.ensureCoordinatorReady(AbstractCoordinator.java:193) at org.apache.kafka.clients.consumer.internals.ConsumerCoordinator.poll(ConsumerCoordinator.java:275) at org.apache.kafka.clients.consumer.KafkaConsumer.pollOnce(KafkaConsumer.java:1030) at org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:995) at com.example.SccSpringCloudDemoApplication.main(SccSpringCloudDemoApplication.java:46)
Problem with AbstractCoordinator.ensureCoordinatorReady() method
It uses Long.MAX_VALUE as timeout.
Attachments
Issue Links
- duplicates
-
KAFKA-3834 Consumer should not block in poll on coordinator discovery
- Resolved
- relates to
-
KAFKA-6783 consumer poll(timeout) blocked infinitely when no available bootstrap server
- Closed
- links to