{"action":"closed","issue":{"url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/948","repository_url":"https://api.github.com/repos/SOHU-Co/kafka-node","labels_url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/948/labels{/name}","comments_url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/948/comments","events_url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/948/events","html_url":"https://github.com/SOHU-Co/kafka-node/issues/948","id":317583175,"number":948,"title":"Does KafkaClient tolerate failure of broker(s) and try to connect other brokers ?","user":{"login":"bylomo","id":11205539,"avatar_url":"https://avatars2.githubusercontent.com/u/11205539?v=4","gravatar_id":"","url":"https://api.github.com/users/bylomo","html_url":"https://github.com/bylomo","followers_url":"https://api.github.com/users/bylomo/followers","following_url":"https://api.github.com/users/bylomo/following{/other_user}","gists_url":"https://api.github.com/users/bylomo/gists{/gist_id}","starred_url":"https://api.github.com/users/bylomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bylomo/subscriptions","organizations_url":"https://api.github.com/users/bylomo/orgs","repos_url":"https://api.github.com/users/bylomo/repos","events_url":"https://api.github.com/users/bylomo/events{/privacy}","received_events_url":"https://api.github.com/users/bylomo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-04-25T11:15:01Z","updated_at":"2018-04-27T07:45:03Z","closed_at":"2018-04-27T07:45:03Z","author_association":"NONE","body":"## Questions?\r\nDoes KafkaClient tolerate failure of broker(s) and try to connect other brokers ?\r\n\r\n## Bug Report\r\nHi team, I am using **KafkaClient** as client parameter of Producer, and I set kafkaHost to _\"host1:port1,host2:port2,host3:port3\"_ , it works when I send a message. Then, I **kill the broker of host1:port1 and send message again via using the cached producer**, it is stucked until request timeout, error message is _TimeoutError: Request timed out after 10000ms_. Then I use debug mode, and check the log of kafka-node, it always display kafka-node:KafkaClient kafka-node-client reconnecting to host1:port1... will it try to connect to host2:port2 or host3:port3 that I provided ? Also, when I debug in client.js, it has a method called getBrokers, seems that it doesn't include all brokers I provided, sometimes only host1:port1, but sometimes [host1:port1, host2:port2] ?\r\n\r\n### Environment\r\n\r\n* Node version: v6.5.9\r\n* Kafka-node version: 2.3.0\r\n* Kafka version: 1.0.0 \r\n* Scala version: 2.11\r\n\r\n### For specific cases also provide\r\n* Number of Brokers: 3\r\n* Number partitions for topic: 1\r\n\r\n### Include Sample Code to reproduce behavior\r\n\r\n```js\r\nvar client = new kafka.KafkaClient({\r\n    kafkaHost: \"host1:port1,host2:port2,host3:port3\",\r\n    connectTimeout: 10000,\r\n    requestTimeout: 10000\r\n});\r\nproducer = new kafka.Producer(client);\r\n```\r\n\r\n### Include output with [Debug](https://github.com/SOHU-Co/kafka-node#how-do-i-debug-an-issue) turned on\r\nkafka-node:KafkaClient checking payload topic/partitions has leaders\r\nkafka-node:KafkaClient found leaders for all\r\nkafka-node:KafkaClient sending request\r\nkafka-node:KafkaClient grouped requests by 1 brokers [\"0\"]\r\nkafka-node:KafkaClient missing apiSupport waiting until broker is ready...\r\nkafka-node:KafkaClient kafka-node-client reconnecting to host1:port1\r\nkafka-node:KafkaClient kafka-node-client reconnecting to host1:port1\r\nkafka-node:KafkaClient kafka-node-client reconnecting to host1:port1\r\nkafka-node:KafkaClient kafka-node-client reconnecting to host1:port1\r\n....\r\nTimeoutError: Request timed out after 10000ms\r\n\r\nBest Regards,\r\nThanks!"}}
{"actor":{"display_login":"bylomo"}}