-
Notifications
You must be signed in to change notification settings - Fork 37.7k
p2p: Replace RecursiveMutex m_tx_inventory_mutex
with Mutex and rename it
#24125
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
Conversation
77c522b
to
50f1534
Compare
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
50f1534
to
d097e5d
Compare
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.
Approach ACK d097e5d
- I agree with the name change of
cs_tx_inventory
->m_tx_inventory_mutex
. - Checked that all the locking instances of
m_tx_inventory_mutex
are protected by a precedingAssertLockNotHeld()
statement. - LOCKS_EXCLUDED macro is appropriately used with all the function definitions where
AssertLockNotHeld()
is used.
There is a minor nit that you should address before merging this PR. 🥂
d097e5d
to
f10db76
Compare
Concept ACK. But reviewing changes in |
To address the external synchronizing, the code snippets below should be encapsulated as bitcoin/src/net_processing.cpp Lines 2038 to 2041 in bd482b3
bitcoin/src/net_processing.cpp Lines 1904 to 1910 in bd482b3
bitcoin/src/net_processing.cpp Lines 4807 to 4935 in bd482b3
|
That is my guess. Of course, it would be nice to hear other devs opinion. |
e587cdf
to
a3b7192
Compare
The new commit addresses most of #24125 (comment). All code snippets protected by Annotations that use negative capabilities were also added. It doesn't seem trivial to bring the code in |
Still working on this? |
@hebasto I hadn't seen the message before. I will try to solve the issue described in the comment above. |
a3b7192
to
7a44768
Compare
@hebasto 88777c4 does the trick, apparently with no change in behavior.. This commit also makes it easier to change |
Are you still working on this? |
After 1066d10, the PR title and description should be updated, no? |
cs_tx_inventory
with Mutex and rename itm_tx_inventory_mutex
with Mutex and rename it
The PR is ready for reviews.
Done. |
m_send_mempool = value; | ||
} | ||
|
||
void Relay( |
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.
I haven't reviewed this pull request, but this would be the first time that a net processing logic is put in the peers struct, instead of the net processing implementation.
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.
The idea is to prevent external synchronizing (acquiring m_tx_inventory_mutex
from outside of the CNode::TxRelay
instance).
Perhaps this requires a more complex refactoring.
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.
@dergoegge you might have thoughts here?
🐙 This pull request conflicts with the target branch and needs rebase. |
This PR is related to #19303 and gets rid of the
RecursiveMutex m_tx_inventory_mutex
and also addsAssertLockNotHeld
macros combined withLOCKS_EXCLUDED
thread safety annotations to avoid recursive locking.