-
Notifications
You must be signed in to change notification settings - Fork 114
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
Issue124 #145
Conversation
Could you please elaborate which methods cause the deadock, for which threads? I'm assuming a deadlock model like this:
|
New block Sealed -> OnBest event -> (BlockHandler thread, T1) callback-> createNewBlockTemplate -> getPendingTransactions -> txpool.snapshot. pow thread (AionPow, T2) -> createNewBlockTemplate -> getPendingTransactions -> txpool.snapshot. |
EquiHash miner (multi tread here!) -> OnSolution event -> (Consensus thread) callback -> event been process by the order of the event queue in the Consensus handler -> processSolution -> import block -> if the best block -> clearPandingTx -> txpool.remove |
|
Awesome! Let's focus on fixing the deadlock between |
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.
This PR removes synchronized keywords, because the methods are called by single thread. Needs to be careful when adding another invoke in the future
fix issue
#124
Due to the synchronized method cause the deadlock between the pendingTxImpl and the txpool and then the event manager callback function get stuck.
Note. each handler of the event manager is a single thread. the callback execute function don't need the synchronized term unless there is another thread calling the same method.