-
Notifications
You must be signed in to change notification settings - Fork 39
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
fix pruner finalize #1860
fix pruner finalize #1860
Conversation
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
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 don't really like this approach with a mutex lock in the beginning of each public method, contrary to more fine-grained mutexes, but I don't know how to do it better here without complex refactoring, so let it be for now.
@@ -91,6 +86,7 @@ namespace kagome::storage::trie_pruner { | |||
const primitives::BlockHeader &state) override; | |||
|
|||
std::optional<primitives::BlockInfo> getLastPrunedBlock() const override { | |||
std::unique_lock lock{mutex_}; |
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.
shared_lock?
Referenced issues
Description of the Change
--state-pruning
Benefits
Possible Drawbacks