node-rpc-ext: Remove rayon (Fix deadlock) #1174
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have got a deadlock in the
khala-node
while getting storage changes.According to the gdb stack frame dump, we found the deadlock is caused by the following flow:
Ideally, this can be solved by replacing the rayon thread pool used in
pha_getStorageChanges
with a separate pool rather than the default one.However, due to the thread pool API of rayon:
The codes running in the inner closure inherit the installed thread_pool automatically.
So it would still deadlock in this single thread like:
Turns out this is an aged issue laying there for a long time.
I've also tried to replace the rayon with a different version:
But it failed to compile due to that they depend on the external lib.
So, let's just remove the rayon at the moment.
@h4x3rotab @jasl