sync: print proper lock order location when double lock is detected#20507
Merged
maflcko merged 3 commits intobitcoin:masterfrom Dec 2, 2020
Merged
sync: print proper lock order location when double lock is detected#20507maflcko merged 3 commits intobitcoin:masterfrom
maflcko merged 3 commits intobitcoin:masterfrom
Conversation
Before: ``` Assertion failed: detected double lock at src/sync.cpp:153, details in debug log. ``` After: ``` Assertion failed: detected double lock for 'm' in src/test/sync_tests.cpp:40 (in thread ''), details in debug log. ```
It is not modified in the function, so should be `const`.
`HasReason()` is shorter than a lambda function.
Contributor
Author
|
To force printing of the message: --- i/src/test/sync_tests.cpp
+++ w/src/test/sync_tests.cpp
@@ -46,5 +46,4 @@ void TestDoubleLock(bool should_throw)
{
const bool prev = g_debug_lockorder_abort;
- g_debug_lockorder_abort = false;
MutexType m;and run |
Member
|
Concept ACK |
Contributor
|
Thanks for fixing! |
Contributor
|
ACK db058ef |
promag
reviewed
Dec 2, 2020
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
Dec 2, 2020
…le lock is detected db058ef sync: use HasReason() in double lock tests (Vasil Dimov) a21dc46 sync: const-qualify the argument of double_lock_detected() (Vasil Dimov) 6d3689f sync: print proper lock order location when double lock is detected (Vasil Dimov) Pull request description: Before: ``` Assertion failed: detected double lock at src/sync.cpp:153, details in debug log. ``` After: ``` Assertion failed: detected double lock for 'm' in src/test/sync_tests.cpp:40 (in thread ''), details in debug log. ``` ACKs for top commit: jonasschnelli: utACK db058ef ajtowns: ACK db058ef hebasto: ACK db058ef, tested on Linux Mint 20 (x86_64). Tree-SHA512: 452ddb9a14e44bb174135b39f2219c76eadbb8a6c0e80d64a25f995780d6dbc7b570d9902616db94dbfabaee197b5828ba3475171a68240ac0958fb203a7acdb
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Before:
After: