diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-07-10 22:13:49 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-07-10 22:13:49 +0000 |
| commit | 06c9730441593c191f968f8041a0e76f56368a39 (patch) | |
| tree | fb228a59295fe22987e3dcfaa51987ce5f3f0f48 /internal/cli/serve.go | |
| parent | 3728fb07ddc9c3a85cf4f2152b35e090618f87db (diff) | |
fix(executor): periodically sweep stale dispatch workspace directories
ContainerRunner preserves a failed execution's workspace indefinitely for
debugging, with no expiry -- this accumulated 161 stale directories
(~17.6GB) and took the host to 100% disk full on 2026-07-10. Pool.RunWorkspaceCleanup
sweeps claudomator-workspace-* dirs older than 24h every hour, started from
serve.go, mirroring StoryOrchestrator.Run's ticker shape. Never removes a
directory still referenced as a currently-BLOCKED task's sandbox_dir,
regardless of age.
Diffstat (limited to 'internal/cli/serve.go')
| -rw-r--r-- | internal/cli/serve.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/cli/serve.go b/internal/cli/serve.go index 393b6bc..4054a3b 100644 --- a/internal/cli/serve.go +++ b/internal/cli/serve.go @@ -283,6 +283,12 @@ func serve(addr, basePath string) error { } go storyOrch.Run(ctx, scheduler.DefaultStoryPollInterval) + // Sweep stale dispatch workspace directories (internal/executor.Pool's + // RunWorkspaceCleanup) — ContainerRunner preserves a failed execution's + // workspace indefinitely for debugging with no expiry of its own, which + // otherwise accumulates forever. See that function's doc comment. + go pool.RunWorkspaceCleanup(ctx, executor.DefaultWorkspaceCleanupInterval, executor.DefaultWorkspaceCleanupMaxAge) + httpSrv := &http.Server{ Addr: addr, Handler: srv.Handler(), |
