-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
consumerGroup will deadlock when handling errors #1554
Comments
@roblaszczak The lock in the error function was introduced in commit 93f4001 . Maybe the lock should be moved to the |
I think the mutex lock can even be safely removed in the |
stevenvdr/sarama@8847ac5 shouldn't be merged, because it will remove fixes for race conditions from #1531 (BTW it would be nice to have some regression test for this in Sarama tests ;), currently it can be checked with Watermill tests, simple description of how to test it is here: #1531). I don't have a lot of time to check it today, but maybe redesigning mutexes a bit may fix the issue (maybe separated mutex just for close?). |
@roblaszczak I've had a look, but I'm not familiar enough with how everything is set up. Could you have a look? |
I think the fix was merged in #1581. I tested with my local consumer group and I no longer get the deadlock. |
I checked with the last release, and it's fine now:
|
Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur. |
Versions
Please specify real version numbers or git SHAs, not just "Latest" since that changes fairly regularly.
Configuration
What configuration values are you using for Sarama and Kafka?
Logs
When filing an issue please provide logs from Sarama and Kafka if at all
possible. You can set
sarama.Logger
to alog.Logger
to capture Sarama debugoutput.
logs: CLICK ME
Problem Description
lock
field in struct ConsumerGroup is a Mutex. https://github.com/Shopify/sarama/blob/c82acaf7831341c57794be79578431c927540840/consumer_group.go#L63And it is used in the following codes
Consume
will callhandleError
in several conditions which will causedeadlock
. For example:https://github.com/Shopify/sarama/blob/c82acaf7831341c57794be79578431c927540840/consumer_group.go#L688
https://github.com/Shopify/sarama/blob/c82acaf7831341c57794be79578431c927540840/consumer_group.go#L694
etc.
The text was updated successfully, but these errors were encountered: