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

KAFKA-6606; Ensure consumer awaits auto-commit interval after sending… #4641

Merged
merged 2 commits into from
Mar 3, 2018

Conversation

hachikuji
Copy link

We need to reset the auto-commit deadline after sending the offset commit request so that we do not resend it while the request is still inflight.

Added unit tests ensuring this behavior and proper backoff in the case of a failure.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@guozhangwang
Copy link
Contributor

cc @huxihx

time.sleep(autoCommitIntervalMs / 2);
coordinator.poll(time.milliseconds(), Long.MAX_VALUE);
assertEquals(1, client.inFlightRequestCount());
client.respond(new MockClient.RequestMatcher() {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Maybe we can consolidate this logic into a function as well? E.g. "respondSentRequest" etc.

Copy link
Author

Choose a reason for hiding this comment

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

ack

Copy link
Contributor

@guozhangwang guozhangwang left a comment

Choose a reason for hiding this comment

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

Nit comment, otherwise LGTM!

@hachikuji
Copy link
Author

One of the builds evidently hung in PlaintextConsumerTest.testLowMaxFetchSizeForRequestAndPartition. I've been trying to reproduce this locally, but so far have been unable to. I think it's unlikely to be related to this fix, so I'm going to go ahead and merge. I'll continue trying to reproduce the failure.

@guozhangwang
Copy link
Contributor

One of the builds evidently hung in PlaintextConsumerTest.testLowMaxFetchSizeForRequestAndPartition. I've been trying to reproduce this locally, but so far have been unable to. I think it's unlikely to be related to this fix, so I'm going to go ahead and merge. I'll continue trying to reproduce the failure.

Sounds good!

@hachikuji hachikuji merged commit 604b93c into apache:trunk Mar 3, 2018
hachikuji pushed a commit that referenced this pull request Mar 3, 2018
#4641)

We need to reset the auto-commit deadline after sending the offset commit request so that we do not resend it while the request is still inflight. 

Added unit tests ensuring this behavior and proper backoff in the case of a failure.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
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.

2 participants