- 
                Notifications
    You must be signed in to change notification settings 
- Fork 51
Fix a deadlock in miner.rs #1968
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
Conversation
| How about just moving the line  | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropping the lock guard of immune_users will not help to fix the deadlock. Since the thread will stop when requiring to lock mem_pool. How about locking mem_pool at the 531st line. To make code always lock mem_pool first?
NextMandatoryReseal limits the lifetime of the inner lock.
NextAllowedReseal limits the lifetime of the inner lock.
Params limits the lifetime of the inner lock.
SealingBlockLastRequest limits the lifetime of the inner lock.
Nrtofiers limits the lifetime of the inner lock.
Users limits the lifetime of the inner lock.
bfbfce1    to
    a9e9700      
    Compare
  
    
There is a deadlock between immune_users and mem_pool.
A client worker thread locks immune_users first and mem_pool second in
prepare_block function.
An HTTP thread locks mem_pool first in import_own_transactions function
and locks immune_users in add_transactions_to_pool function.
It seems that this deadlock is added when we add immune_users lock. We
need to review the lock of immune_users.