Commit graph

3 commits

Author SHA1 Message Date
Dudu-0223
a268aada8c fix(spill-local): harden startup cleanup 2026-08-24 16:33:15 +08:00
Dudu-0223
545d177911 fix(spill-local): make startup cleanup race-safe 2026-08-24 15:36:51 +08:00
Dudu-0223
2f430f2fbd feat(spill-local): one-shot startup cleanup for local spill files
The local spill backend never reclaimed its files, so configured roots
grew without bound and default per-process dsh-spill-* temp roots piled
up across runs. Immediate deletion is unsafe because persisted, resumed,
and forked sessions may still reference an older locator.

Add a fiber-owned, best-effort sweep that runs once after activation
(never delaying availability, awaited on disposal): it deletes regular
files older than cleanupPeriodDays (default 30; 0 disables) across the
configured root and prior default temp roots, prunes emptied dirs, and
skips symlinks/unknown entries. Every filesystem failure is contained
and logged, so the sweep cannot fail activation or a concurrent write.
2026-08-24 15:36:51 +08:00