-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: fix deadlock in splitstore-mpool interaction #10840
Conversation
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.
1 comment, other than that looks good
blockstore/splitstore/splitstore.go
Outdated
@@ -164,7 +164,7 @@ type SplitStore struct { | |||
path string | |||
|
|||
mx sync.Mutex | |||
warmupEpoch abi.ChainEpoch // protected by mx | |||
warmupEpoch int64 // atomically accessed |
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.
Can't tell if this int is properly aligned, probably use the atomic.Int64
type, which is way safer/harder to mess up.
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.
Can also remove lock around warmupEpoch here
Maybe mx
should now be renamed protectorsLk since its only protecting protectors now afaict.
a73e520
to
1cf36d8
Compare
1cf36d8
to
52e7546
Compare
Related Issues
Fixes #9846.
This deadlock was being caused by attempting to access the warmupepoch variable, which was behind the splitstore.mx lock. We can just access this variable atomically.
Proposed Changes
Additional Info
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, testarea
, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps