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

consumer: bugfix for broker workers getting stuck #369

Merged
merged 1 commit into from
Mar 19, 2015

Conversation

eapache
Copy link
Contributor

@eapache eapache commented Mar 19, 2015

Very similar to #367 (on the producer): the consumer could have added new
references to a brokerConsumer that was shutting down, leading it to spin with
an error unnecessarily.

Add a test for this case.

@Shopify/kafka

delete(c.brokerConsumers, broker)
if c.brokerConsumers[brokerWorker.broker] == brokerWorker {
delete(c.brokerConsumers, brokerWorker.broker)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

So if I understand it correctly, this if case only triggers during a normal consumer shutdown? When we shut down because of a broker error, this delete will already have happened?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It triggers when all PartitionConsumers move off of the brokerConsumer "safely", either via being closed or via a NotLeaderForPartition response. When the broker blows up we abort, and the delete happens immediately to prevent new partitions from taking a reference.

Very similar to #367 (on the producer): the consumer could have added new
references to a brokerConsumer that was shutting down, leading it to spin with
an error unnecessarily.

Add a test for this case.
@eapache eapache force-pushed the fix-consumer-references branch from da3d3bc to d988e6d Compare March 19, 2015 14:45
@wvanbergen
Copy link
Contributor

🆒 just was convincing myself what was going on here. :shipit:

eapache added a commit that referenced this pull request Mar 19, 2015
consumer: bugfix for broker workers getting stuck
@eapache eapache merged commit 7f455c8 into master Mar 19, 2015
@eapache eapache deleted the fix-consumer-references branch March 19, 2015 14:52
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