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

Shrink the scope of the partition circuit-breaker #467

Merged
merged 2 commits into from
Jun 9, 2015

Conversation

eapache
Copy link
Contributor

@eapache eapache commented Jun 9, 2015

It shouldn't wrap the entirety of assignPartition, since that also protects
things like the call to actually choose the partition. The only thing it is
supposed to protect is the call to get the list of partitions, since that is
what can block.

This may or may not fix (or be the right way to fix) #466.

@ssahukar @Shopify/kafka

@eapache eapache force-pushed the shrink-partitioner-breaker branch from 0cba7e3 to e3a4139 Compare June 9, 2015 15:27
@wvanbergen
Copy link
Contributor

I think this should fix #466.

How hard would it be to construct a test for this?

@eapache
Copy link
Contributor Author

eapache commented Jun 9, 2015

A test that partitioner errors are not part of the breaker, or a test that Partition() errors are part of the breaker? Neither is particularly tricky I don't think, but I'm also not sure if either are particularly useful.

@wvanbergen
Copy link
Contributor

I think a test for a custom partitioner would be good. We explicitly designed to allow this but it's not really tested. The fact that it should be not part of the circuit breaker could be part of it.

A test for having Partition() inside a breaker would be nice to have to but is less needed IMHO.

@eapache
Copy link
Contributor Author

eapache commented Jun 9, 2015

test added; ended up touching a lot of lines because I generalized expectSuccesses to expectResults.

👀 when ready

@eapache eapache force-pushed the shrink-partitioner-breaker branch from 80c605f to b21ab84 Compare June 9, 2015 18:01
It shouldn't wrap the entirety of `assignPartition`, since that also protects
things like the call to actually choose the partition. The only thing it is
supposed to protect is the call to get the list of partitions, since that is
what can block.
@wvanbergen
Copy link
Contributor

LGTM 👍

eapache added a commit that referenced this pull request Jun 9, 2015
Shrink the scope of the partition circuit-breaker
@eapache eapache merged commit 377669e into master Jun 9, 2015
@eapache eapache deleted the shrink-partitioner-breaker branch June 9, 2015 18:27
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