Closed majecty closed 4 years ago
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.
How about just moving the line let immune_users = self.immune_users.read(); to the 565th line ?
let immune_users = self.immune_users.read();
@HoOngEe @sgkim126 I agree with Seulgi. Locking mem_pool first will be better.
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.