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

producer: bugfix for aggregators getting stuck #368

Merged
merged 2 commits into from
Mar 19, 2015
Merged

Conversation

eapache
Copy link
Contributor

@eapache eapache commented Mar 19, 2015

In circumstances where Flush.Messages and/or Flush.Bytes were set but
Flush.Frequency was not, the producer's aggregator could get stuck on a retry
because a metadata-only chaser message would not be enough on its own to trigger
a flush, and so it would sit in limbo forever.

Always trigger a flush in the aggregator when the message is a chaser. This has
the additional benefit of reducing retry latency when Flush.Frequency is set.

Add a test for this case.

@Shopify/kafka

eapache added 2 commits March 19, 2015 01:45
In circumstances where Flush.Messages and/or Flush.Bytes were set but
Flush.Frequency was not, the producer's aggregator could get stuck on a retry
because a metadata-only chaser message would not be enough on its own to trigger
a flush, and so it would sit in limbo forever.

Always trigger a flush in the aggregator when the message is a chaser. This has
the additional benefit of reducing retry latency when Flush.Frequency *is* set.

Add a test for this case.
@eapache eapache force-pushed the flush-retry-recovery branch from 191d912 to a381b36 Compare March 19, 2015 06:14
@eapache
Copy link
Contributor Author

eapache commented Mar 19, 2015

This PR also DRYs up a pattern in the tests that was annoying me

}
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@wvanbergen
Copy link
Contributor

This makes sense to me; if the test case went from red to green I am happy.

Would writing these tests be easier if we would have a mock Client?

@eapache
Copy link
Contributor Author

eapache commented Mar 19, 2015

This test in particular was straightforward - I'd have to think about the other two.

eapache added a commit that referenced this pull request Mar 19, 2015
producer: bugfix for aggregators getting stuck
@eapache eapache merged commit 963015e into master Mar 19, 2015
@eapache eapache deleted the flush-retry-recovery branch March 19, 2015 14:33
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