-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise NotNotReadyError from KafkaConsumer.poll after a retry timeout if the KafkaBroker is not available #1000
Conversation
Conflicts: kafka/client_async.py
Please only review the comparison of the files because the intermediate 48 commits are for getting to know what to change. |
you know there's always |
I appreciate the PR, but I'm not a fan of this change. We try to stay fairly consistent with the java client configuration options so I dont like to add new options that dont exist upstream unless absolutely necessary. It looks like the problem you are trying to solve is that |
Java client has the same behavior reported as an issue. (https://issues.apache.org/jira/browse/KAFKA-1894) I will also test it with the same scenario. To get the messages in a topic I use KafkaConsumer.poll and it never returns if the broker is not there. How can I understand it is not there? |
Java consumer is has a "consumer.timeout.ms" configuration option which lets ConsumerIterator.hasNext() to timeout and raise ConsumerTimeoutException. Its default value is -1 so that it never times out. |
@zembunia if you're still interested in this PR, can you rebase and cleanup the commit history (see comment above about squashing) so that it's easier to review/discuss? |
#1209 replaces this PR |
KafkaConsumer.poll never returns in case of no connection with the KafkaBroker. This exception gives a chance to the outer program to know about the problem.