fix: deadlock over cs_main and contributionsCacheCs in dkssessionmgr#5962
Merged
PastaPastaPasta merged 1 commit intodashpay:developfrom Apr 2, 2024
Merged
Conversation
It fixes rpc failure: "Work queue depth exceeded"
|
Guix Automation has began to build this PR tagged as v21.0.0-devpr5962.ded1b5a3. A new comment will be made when the image is pushed. |
|
Guix Automation has completed; a release should be present here: https://github.com/dashpay/dash-dev-branches/releases/tag/v21.0.0-devpr5962.ded1b5a3. The image should be on dockerhub soon. |
Collaborator
Author
|
@PastaPastaPasta whatever this PR fix "rpc queue" or it won't, there's a fix for known deadlock that I discovered. Even if it is not full fix for "rpc queue issue", that PR is worth to get merged. Later one being merged it can be backported to 20.1.1 and we will have an extra release with it (without waiting version 21), or will not have an extra release: changes are trivial to backport. |
PastaPastaPasta
approved these changes
Apr 2, 2024
PastaPastaPasta
added a commit
to PastaPastaPasta/dash
that referenced
this pull request
Apr 3, 2024
…Cs in dkssessionmgr ded1b5a fix: deadlock over cs_main and contributionsCacheCs in dkssessionmgr (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented **It fixes rpc failure: "Work queue depth exceeded"** As I checked on running `dashd` in deadlock condition: Thread 78 is a thread that keep `cs_main`: ``` #14 0x0000aaaad1f8d604 in BuildSimplifiedMNListDiff () at evo/simplifiedmns.cpp:364 ``` but it is locked by `contributionsCacheCs` ``` #8 llmq::CDKGSessionManager::GetVerifiedContributions () at llmq/dkgsessionmgr.cpp:392 ``` On other hand, `contributionsCacheCs` is blocked by Thread 59 ``` #17 0x0000aaaad1ba1940 in llmq::CDKGSessionManager::GetVerifiedContributions () at llmq/dkgsessionmgr.cpp:393 ``` and it makes circuit lock by waiting `cs_main` in ``` #9 ReadBlockFromDisk () at node/blockstorage.cpp:75 ``` See dashpay/dash-issues#69 for more details Seems introduced there: dashpay#3911 ## What was done? Deadlock is removed by reducing scope of mutex ## How Has This Been Tested? I reviewed 2 different servers which have status `work queue exceeded`, both have same deadlock, so, this patch should fix this issue. Once this fix is merged, we can test it on testnet. ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone Top commit has no ACKs. Tree-SHA512: 4fe5c03c464ee6934fb927b897f007b65a8995723196edaffdae067edee7067da151130d4c4bac47d3418fdad5c8e130682f42d7ef9c044380a8c8fff78ee008
PastaPastaPasta
added a commit
that referenced
this pull request
Apr 3, 2024
b96b202 chore: bump version to 20.1.1 (pasta) 83cac77 docs: add v20.1.1 release notes (pasta) e58c7c4 Merge #5970: guix: exclude debug symbols for apple from list of hashes due to its non-determinism (pasta) 2bde1dd Merge #5927: fix: check if message can be handled before attempting to deserialize (pasta) 1637fa5 Merge #5968: docs: add v20.0.4 release notes (pasta) fd46c4c Merge #5962: fix: deadlock over cs_main and contributionsCacheCs in dkssessionmgr (pasta) Pull request description: ## Issue being fixed or feature implemented Backport to v20.1.x and release v20.1.1 ## What was done? Backports and release ## How Has This Been Tested? ## Breaking Changes None ## Checklist: _Go over all the following points, and put an `x` in all the boxes that apply._ - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ Top commit has no ACKs. Tree-SHA512: 40574df3349bf1c653a50b4efbf78d1654eb048eeeb483eb657eec5f2af102f95cff8f978a98c174925d2672d56426238a1b7ec3e8cd2a53ec28c0fca42c1293
PastaPastaPasta
added a commit
that referenced
this pull request
Apr 9, 2024
b96b202 chore: bump version to 20.1.1 (pasta) 83cac77 docs: add v20.1.1 release notes (pasta) e58c7c4 Merge #5970: guix: exclude debug symbols for apple from list of hashes due to its non-determinism (pasta) 2bde1dd Merge #5927: fix: check if message can be handled before attempting to deserialize (pasta) 1637fa5 Merge #5968: docs: add v20.0.4 release notes (pasta) fd46c4c Merge #5962: fix: deadlock over cs_main and contributionsCacheCs in dkssessionmgr (pasta) Pull request description: Merge master into develop Top commit has no ACKs. Tree-SHA512: e65ffefcb7d0e92367ff322cab533f8505f0e9d00ab136bccb1dbf86ad64d6b710b5c9f9943594c544827d2eb69f5d0ba185962a2ac0b16c6b776a94f44cfb42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue being fixed or feature implemented
It fixes rpc failure: "Work queue depth exceeded"
As I checked on running
dashdin deadlock condition:Thread 78 is a thread that keep
cs_main:but it is locked by
contributionsCacheCsOn other hand,
contributionsCacheCsis blocked by Thread 59and it makes circuit lock by waiting
cs_maininSee https://github.com/dashpay/dash-issues/issues/69 for more details
Seems introduced there: #3911
What was done?
Deadlock is removed by reducing scope of mutex
How Has This Been Tested?
I reviewed 2 different servers which have status
work queue exceeded, both have same deadlock, so, this patch should fix this issue. Once this fix is merged, we can test it on testnet.Breaking Changes
N/A
Checklist: