Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

### Fixed

- [#5863](https://github.com/ChainSafe/forest/pull/5863) Fixed needless GC runs on a stateless node.

## Forest v0.28.0 "Denethor's Folly"

This is a non-mandatory release recommended for all node operators. It includes numerous fixes and quality-of-life improvements for development and archival snapshot operations. It also includes a memory leak fix that would surface on long-running nodes.
Expand Down
15 changes: 10 additions & 5 deletions src/daemon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,11 +508,16 @@ pub(super) async fn start(
.set(snap_gc.clone())
.ok()
.context("failed to set GLOBAL_SNAPSHOT_GC")?;
tokio::task::spawn({
let snap_gc = snap_gc.clone();
async move { snap_gc.event_loop().await }
});
if !opts.no_gc {

// If the node is stateless, GC shouldn't get triggered even on demand.
if !opts.stateless {
tokio::task::spawn({
let snap_gc = snap_gc.clone();
async move { snap_gc.event_loop().await }
});
}
// GC shouldn't run periodically if the node is stateless or if the user has disabled it.
if !opts.no_gc && !opts.stateless {
tokio::task::spawn({
let snap_gc = snap_gc.clone();
async move { snap_gc.scheduler_loop().await }
Expand Down
Loading