-
Notifications
You must be signed in to change notification settings - Fork 21
fix: move delete onto separate thread #629
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
WalkthroughThe truncation loop in the ledger truncator is moved from synchronous execution to a blocking thread pool via Changes
Sequence Diagram(s)sequenceDiagram
participant Async Runtime
participant Thread Pool
participant Ledger
rect rgb(200, 240, 255)
Note over Async Runtime,Ledger: Before: Blocking in async context
Async Runtime->>Ledger: delete_slot_range (chunks)
Ledger-->>Async Runtime: per-chunk results
Async Runtime->>Ledger: flush()
Ledger-->>Async Runtime: flush result
end
rect rgb(240, 220, 255)
Note over Async Runtime,Ledger: After: Non-blocking via spawn_blocking
Async Runtime->>Thread Pool: spawn_blocking task
activate Thread Pool
Thread Pool->>Ledger: delete_slot_range (chunks)
Ledger-->>Thread Pool: per-chunk results
Thread Pool->>Ledger: flush()
Ledger-->>Thread Pool: flush result
deactivate Thread Pool
Thread Pool-->>Async Runtime: task result / cancellation
end
Async Runtime->>Ledger: compact_slot_range()
Ledger-->>Async Runtime: compaction result
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings🧬 Code graph analysis (1)magicblock-ledger/src/ledger_truncator.rs (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Manual Deploy AvailableYou can trigger a manual deploy of this PR branch to testnet: Alternative: Comment
Comment updated automatically when the PR is synchronized. |
bmuddha
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, seems like it has fixed the startup freeze.
Summary by CodeRabbit