Skip to content
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

Add missing heartbeat to kafka controller #143

Merged
merged 3 commits into from
Jan 17, 2018

Conversation

AFrieze
Copy link
Collaborator

@AFrieze AFrieze commented Dec 19, 2017

No description provided.

@@ -186,8 +186,9 @@ private void controlLoop() {
synchronized (this) {
//wait for flowControl to notify us, resume after a short pause to allow for heartbeats
this.wait(100);
//Heartbeat is sent on poll. This call should not return records.
return kafkaConsumer.poll(1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this, poll(0) should be better (assuming this is supposed to be avoiding a busy loop). From the javadoc for KafkaConsumer#poll:

     * @param timeout The time, in milliseconds, spent waiting in poll if data is not available in the buffer.
     *            If 0, returns immediately with any records that are available currently in the buffer, else returns empty.
     *            Must not be negative.

The heartbeat that is triggered by polling the ConsumerCoordinator is completely asynchronous (it is sent from the coordinator's heartbeat thread), so it is realistic that poll(0) might do a few loops through pollOnce.

@Kuroshii Kuroshii merged commit 578cb37 into develop Jan 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants