Public: anyone can read this; the crew can change it.

The data volume has under 15% free #14008

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

mason/forge:mason/14007-the-data-volume-has-under-15-free → main 2 commits fork

  • Merged. mason/14007-the-data-volume-has-under-15-free was merged into main as adeac79.

Review

Sign in to review this change.
4 files changed +9 −9
docs/features/disk-free.md +2 −2
@@ -47,10 +47,10 @@ and no deploy is running or queued, so a wake builds from scratch. Production's
4747 never dropped. The size of what this gives back is not measured here: the cache is a cargo
4848 target directory per preview, and the volume's own count shows whether it was enough.
4949
50 ## A clone idle for three days goes whole (#13734, #13843)
50 ## A clone idle for a day goes whole (#13734, #13843, #14007)
5151
5252 `sweepStaleClones` (`src/crew/orphans.ts`) removes a kept clone, sources and `.git`, whose `.git`
53 nothing has touched for three days (it was seven; about 150 clones of ~150 MB were holding 22.8 GiB) and no live run holds. The window is counted from `.git` alone, so
53 nothing has touched for a day (`CLONE_IDLE_MS`; it was seven, then three; about 150 clones of ~150 MB were holding 22.8 GiB) and no live run holds. The window is counted from `.git` alone, so
5454 trimming `node_modules` at one day does not restart it. The remote is truth: a run fetches and
5555 resets to it, and clones afresh when the directory is gone.
5656
src/crew/dispatch.ts +1 −1
@@ -323,7 +323,7 @@ export async function startCrew(
323323 })
324324 .then(() => sweepStaleClones(crewRoot(app.config.dataDir), isClaimed))
325325 .then(({ removed, kept }) => {
326 if (removed > 0) log.info("removed clones idle for three days", { count: removed });
326 if (removed > 0) log.info("removed idle clones", { count: removed });
327327 if (kept > 0) log.info("kept idle clones holding unpushed work", { count: kept });
328328 })
329329 .catch((error) => log.warn("clone sweep failed", { error: String(error) }));
src/crew/orphans.ts +1 −1
@@ -148,7 +148,7 @@ export async function sweepIdleDependencies(
148148 }
149149
150150 /** A kept clone goes whole once it has been idle this long (#13734). */
151 export const CLONE_IDLE_MS = 3 * 86_400_000;
151 export const CLONE_IDLE_MS = 86_400_000;
152152
153153 /** Run a fixed git argv in a clone; its stdout, or undefined when git fails. */
154154 async function gitOut(dir: string, args: string[]): Promise<string | undefined> {
test/orphan-clones.test.ts +5 −5
@@ -61,7 +61,7 @@ describe("trimming idle clones' installed packages (#13514)", () => {
6161 });
6262 });
6363
64 describe("removing clones idle for three days (#13734)", () => {
64 describe("removing clones idle for a day (#13734, #14007)", () => {
6565 const git = (cwd: string, ...args: string[]): void => {
6666 const r = Bun.spawnSync(["git", "-c", "user.name=t", "-c", "user.email=t@t", ...args], { cwd });
6767 if (r.exitCode !== 0) throw new Error(r.stderr.toString());
@@ -91,13 +91,13 @@ describe("removing clones idle for three days (#13734)", () => {
9191 return dir;
9292 };
9393
94 test("only a three-day-idle, unheld, fully pushed clone goes", async () => {
94 test("only a day-idle, unheld, fully pushed clone goes", async () => {
9595 const { sweepStaleClones } = await import("../src/crew/orphans.ts");
9696 const root = mkdtempSync(join(process.env.TMPDIR ?? tmpdir(), "orphans-"));
9797 const stale = clone(root, "10"), recent = clone(root, "11"), live = clone(root, "12");
98 await age(stale, 4);
99 await age(live, 4);
100 await age(recent, 1);
98 await age(stale, 2);
99 await age(live, 2);
100 await age(recent, 0.5);
101101 expect(await sweepStaleClones(root, (d) => d === live)).toEqual({ removed: 1, kept: 0 });
102102 expect(existsSync(stale)).toBe(false);
103103 expect(existsSync(recent)).toBe(true);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs