-
Notifications
You must be signed in to change notification settings - Fork 38
Fix memory leaks in V2 LedgerDB #1814
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
base: main
Are you sure you want to change the base?
Conversation
169406b to
cbffec9
Compare
cdeb19e to
7b0f9ab
Compare
cbffec9 to
c82750a
Compare
7b0f9ab to
c8c453b
Compare
bladyjoker
left a comment
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.
Hey Javier, good stuff here! Left some comment, let me know what you think
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2/InMemory.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2/InMemory.hs
Outdated
Show resolved
Hide resolved
| p <- atomically $ swapTVar tv' LedgerTablesHandleClosed | ||
| case p of | ||
| LedgerTablesHandleOpen{} -> encloseTimedWith (TraceLedgerTablesHandleClose >$< tracer) $ pure () | ||
| _ -> pure () |
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 can see it being useful to know how many times this happens. Shall we emit a trace here?
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 think it is that interesting. What would you infer with that information?
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 guess I don't know when this will happen. The condition for this to happen might mean that smtn is off and a trace would help debug this?
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2/InMemory.hs
Outdated
Show resolved
Hide resolved
c82750a to
9964ec2
Compare
c8c453b to
54a30dd
Compare
|
This seems to have introduced a bug in the immutable db re-opening: |
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2/InMemory.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2/InMemory.hs
Outdated
Show resolved
Hide resolved
ab26bd9 to
f72045a
Compare
bladyjoker
left a comment
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.
LGTM!
| error $ | ||
| "Critical invariant violation: block " | ||
| <> show from | ||
| <> " that was in immutable db is gone before we could open ledgerdb" |
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 need you to change this just a thought as I think we could do a nice spring cleaning when it comes to tracing.
I'd still like to have a machine readable log event for this outputted as CRITICAL, and ofc a human readable version of this.
LogFormatting class does that and it's in trace-dispatcher package.
No description provided.