You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Ray Chiang (JIRA)" <ji...@apache.org> on 2018/07/19 18:18:00 UTC
[jira] [Updated] (KAFKA-7113) AdminClient.create has an infinite
retry loop bug
[ https://issues.apache.org/jira/browse/KAFKA-7113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ray Chiang updated KAFKA-7113:
------------------------------
Component/s: admin
> AdminClient.create has an infinite retry loop bug
> -------------------------------------------------
>
> Key: KAFKA-7113
> URL: https://issues.apache.org/jira/browse/KAFKA-7113
> Project: Kafka
> Issue Type: Bug
> Components: admin
> Reporter: 02tmqrmje9
> Priority: Major
>
> When you try to instantiate an KafkaAdminClient using the factory method AdminClient.create it returns a client while side-effecting with a background thread stuck in a retry loop forever attempting to get broker metadata when brokers are not accessible.
> Running the below code:
>
> {code:java}
> val props = new Properties()
> props.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:8080)
> AdminClient.create(props)
> {code}
> Will result in an endless loop of the below forever:
>
>
> {code:java}
> Connection to node -1 could not be established. Broker may not be available
> {code}
> As create returns an AdminClient value straight away and forks to a background thread there is no way to know if the client instantiated successfully or not and to handle the error case.
> * Calling create ideally should not side affect as it's equivalent to a side-effecting constructor
> * At the least calling create should fatally fail if it can't talk to the brokers so the error case can be handled, i.e so a user can fail fast and propagate errors.
>
>
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)