Affects Version/s: 0.8.2.0
Fix Version/s: None
I'm seeing issues when sending a message with the new producer client API. The future returned from Producer.send() will block indefinitely if the cluster is unreachable for some reason. Here are the steps:
- Start up a single node kafka cluster locally.
- Start up application and create a KafkaProducer with the following config:
- Send some messages...they are successfully sent
- Shut down the kafka broker
- Send another message.
At this point, calling get() on the returned Future will block indefinitely until the broker is restarted.
It appears that there is some logic in org.apache.kafka.clients.producer.internal.Sender that is supposed to mark the Future as "done" in response to a disconnect event (towards the end of the run(long) method). However, the while loop earlier in this method seems to remove the broker from consideration entirely, so the final loop over ClientResponse objects is never executed.
It seems like "timeout.ms" configuration should be honored in this case, or perhaps introduce another timeout, indicating that we should give up waiting for the cluster to return.