-
Couldn't load subscription status.
- Fork 33
Carry a forker in the mempool #1565
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
11bad3a to
1eabc2b
Compare
506d793 to
bf9c254
Compare
36e01ae to
ae188df
Compare
bf9c254 to
95bd119
Compare
6b00088 to
9d4748d
Compare
0366e24 to
690bfaf
Compare
0972dfc to
c02aea1
Compare
ouroboros-consensus/changelog.d/20250620_132627_jasataco_mempool_carry_vh.md
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/API.hs
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/Impl/Common.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/Impl/Common.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/Impl/Common.hs
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/Init.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/Update.hs
Outdated
Show resolved
Hide resolved
5e66a72 to
a7e96d3
Compare
a7e96d3 to
e2d80d1
Compare
c02aea1 to
82392d5
Compare
8676768 to
0e92ed1
Compare
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/API.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/Init.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/Init.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/Update.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/Init.hs
Show resolved
Hide resolved
|
Note to self: remove now stale mempool traces (TraceMempoolLedgerNotFound for example) |
0e92ed1 to
1940671
Compare
| -- With this allocation on the top level registry, we make sure that we first | ||
| -- stop the watcher thread before closing the mempool registry, as otherwise | ||
| -- we would run into a race condition (the thread might try to re-sync and | ||
| -- allocate a forker on the mempool registry which would be closing down). | ||
| void $ allocate topLevelRegistry (\_ -> pure w) cancelThread |
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.
@jasagredo I came across this code while reviewing #1738. Is this code here still necessary with your recent work in IntersectMBO/io-classes-extra#10?
Description
The mempool will now carry its own forker instead of acquiring one on each
revalidation. This particularly implies that the mempool will no longer
re-sync under the hood while trying to add a transaction, and only the
background thread will perform such a re-sync.
The mempool now has its own registry in which it allocates forkers. The
background thread was moved to this inner registry such that it can access the
mempool internal registry, but an action to cancel it will still live in the
outer registry, to ensure the thread is closed before we attempt to close the
mempool internal registry. Otherwise we would run into a race condition if the
background thread would attempt a resync while the internal registry was being
closed.