-
Notifications
You must be signed in to change notification settings - Fork 182
fix: no GC for stateless nodes #5863
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 changes update the daemon startup logic to prevent garbage collection (GC) tasks from running when the node is in stateless mode. Both the GC event loop and the periodic GC scheduler loop are now conditionally spawned only if the node is not stateless, with the scheduler loop also requiring GC to be enabled. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested reviewers
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
6c0104d to
5c937f2
Compare
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
CHANGELOG.md (1)
38-39: Consider tightening wording for parallel-structure & readabilityThe plural “nodes” is already used elsewhere and reads more naturally. Suggest:
- [#5863](https://github.com/ChainSafe/forest/pull/5863) Fixed needless GC runs on a stateless node. + [#5863](https://github.com/ChainSafe/forest/pull/5863) Fixed needless GC runs on stateless nodes.Purely a stylistic nit—feel free to ignore if you prefer the current phrasing.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
CHANGELOG.md(1 hunks)src/daemon/mod.rs(1 hunks)
⏰ 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). (6)
- GitHub Check: Build forest binaries on Linux AMD64
- GitHub Check: tests-release
- GitHub Check: tests
- GitHub Check: cargo-publish-dry-run
- GitHub Check: Build Ubuntu
- GitHub Check: All lint checks
🔇 Additional comments (2)
src/daemon/mod.rs (2)
512-518: LGTM! Proper prevention of on-demand GC for stateless nodes.The conditional check correctly prevents the GC event loop from being spawned when the node is stateless. This addresses the PR objective of preventing on-demand GC operations on stateless nodes, which is appropriate since stateless nodes don't maintain persistent state that would benefit from garbage collection.
519-521: LGTM! Consistent logic for preventing periodic GC on stateless nodes.The additional
!opts.statelesscondition properly extends the existing GC scheduler logic. The combined condition!opts.no_gc && !opts.statelessensures that periodic GC is disabled when either explicitly disabled by the user or when running in stateless mode, which maintains consistency with the event loop logic above.
Summary of changes
Changes introduced in this pull request:
Reference issue to close (if applicable)
Closes
Other information and links
Change checklist
Summary by CodeRabbit
Bug Fixes
Documentation