Skip to content

(Attempt to) Fix deadlock between consumer and heartbeat #1628

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

Merged
merged 1 commit into from
Nov 10, 2018

Conversation

dpkp
Copy link
Owner

@dpkp dpkp commented Nov 10, 2018

This is an attempt to address / fix #1623 and #1626. Major shout out to zhgjun for investigating and suggesting this fix!

Given the thread setup we have right now, I think the easiest way to prevent deadlock is to always acquire the client lock before the coordinator lock. There are still some places in the code that only acquire the coordinator lock. Leaving these in place is dangerous, but I don't think any of them have any possible code path that leads to acquiring the client lock while still holding the coordinator lock.

I've also modified the client poll loop to keep the client lock during callback handling. I don't think this is specifically necessary to fix the deadlock issue reported in the issues above, but I also don't think dropping the client lock before processing callbacks adds any value at this point.


This change is Reviewable

@dpkp dpkp merged commit 0a2ccba into master Nov 10, 2018
@dpkp dpkp deleted the consumer_heartbeat_deadlock branch November 10, 2018 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants