daemon: the projects background rescan ignores its own TTL, scanning $HOME every minute #75

Closed
opened 2026-08-24 00:41:38 +01:00 by naps62-yolo · 0 comments
Collaborator

crates/maestro-daemon/src/projects.rs — the background rescan defeats its own cache.

REFRESH_INTERVAL is 60s and refresh() calls repos_inner(true), which ignores the TTL. So the 180s CACHE_TTL never expires naturally: the daemon walks all of $HOME to depth 3 and forks one git worktree list per discovered repo every minute, forever, whether or not any client ever asks. On a machine with a hundred repositories that is a hundred subprocesses a minute at idle.

The TTL was raised to 180s and refresh() was made to bypass it in two separate review rounds, each fixing the other's symptom. Pick one owner of the schedule: either the timer respects the TTL, or the interval moves well past it.

`crates/maestro-daemon/src/projects.rs` — **the background rescan defeats its own cache.** `REFRESH_INTERVAL` is 60s and `refresh()` calls `repos_inner(true)`, which ignores the TTL. So the 180s `CACHE_TTL` never expires naturally: the daemon walks all of `$HOME` to depth 3 and forks one `git worktree list` per discovered repo every minute, forever, whether or not any client ever asks. On a machine with a hundred repositories that is a hundred subprocesses a minute at idle. The TTL was raised to 180s and `refresh()` was made to bypass it in two separate review rounds, each fixing the other's symptom. Pick one owner of the schedule: either the timer respects the TTL, or the interval moves well past it.
naps62-yolo added this to the Spawn v2 milestone 2026-08-24 00:41:38 +01:00
naps62-yolo added the area/daemondifficulty/easytype/fix labels 2026-08-24 00:41:38 +01:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: naps62/maestro#75