You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Android: on ext4 and NTFS every lease copies the whole seed, 3 to 5 GB #1750
Every Android lease gets its own copy of its kind's seed AVD folder (ADR 0061), made by Filesystem.copyTree (src/ports/filesystem.ts:224-235):
Worker
Copy
Disk per lease
macOS, APFS
cp -c -p -R (clone)
only what the emulator writes
Linux, btrfs / XFS
cp -a --reflink=auto (clone)
only what the emulator writes
Linux, ext4
cp -a --reflink=auto falls back to a full copy without a word (ext4 has no reflink)
the whole seed
Windows, NTFS
Node fs.cp, always a full copy
the whole seed
A seed is 2.7 GB (one kind on a macOS worker, du of sources/seed_*/simlock.avd) to ~4.8 GB (ADR 0061's measurement), most of it the boot snapshot's ram.bin (2.0 GB) and userdata-qemu.img.qcow2. So on ext4 and NTFS, the most common filesystems of Linux and Windows workers, each Android lease writes 3 to 5 GB before its emulator boots, and ten leases at once hold 30 to 50 GB. ADR 0061 names the cost ("elsewhere each Android copy is a full copy") but nothing bounds it.
What you expected
An Android lease on any supported worker costs about what its emulator writes, not a whole seed, or at least the worker knows the cost before it takes it: a lease is refused or waits when the copy would not fit, instead of filling the disk.
How to reproduce
On a Linux worker with an ext4 root (or a Windows worker on NTFS), lease one Android emulator: simlock lease --platform android.
Before and after the lease, read the free space of the volume holding drivers.android.deviceRoot (df -k <root>, or Get-PSDrive on Windows).
Free space drops by the seed's size (du -sh <root>/sources/seed_*/simlock.avd), plus what the emulator writes.
Not yet run on an ext4 or NTFS worker: the numbers above come from reading copyTree and from a seed and a copy on a macOS worker.
Environment
Any Linux worker without reflink (ext4) or any Windows worker. Simlock at mainfb42676.
Logs and evidence
src/ports/filesystem.ts:224-235: the three copyTree paths.
src/drivers/android/seeds.ts:696-714: #copyAvd copies the whole simlock.avd folder for every device.
ADR 0061, Consequences: "Copies are copy-on-write on APFS and on Linux filesystems with reflink; elsewhere each Android copy is a full copy."
ADR 0061, Alternatives: a copy under another AVD name loses the snapshot (~16 s cold boot), and a shared -read-only AVD breaks the ownership gate, so neither is a drop-in fix.
Gap. ADR 0061 accepts a full copy on ext4 and NTFS; making it cheap there is a decision (a superseding ADR; its Alternatives rule out both drop-ins). What is missing is a free-space check before the copy. The expectation is a proposal: refuse with InsufficientDiskSpaceError.
src/drivers/android/seeds-copies.test.ts, "refuses a copy of the seed that does not fit in the device root's free space before copying, and copies one that fits exactly", on bug/1750-repro:
pnpm exec vitest run --project unit src/drivers/android/seeds-copies.test.ts -t 'does not fit'
AssertionError: promise resolved "{ address: '', …(2) }" instead of rejecting
❯ seeds-copies.test.ts:321 await expect(short.provision).rejects.toMatchObject({ ... requiredBytes: seedBytes })
A 4,112-byte seed is copied into a root with 4,111 bytes free; the exact-fit case passes.
Root cause
src/drivers/android/seeds.ts:696-714 (#copyAvd) calls filesystem.copyTree with no free-space check; DiskSpaceGuard (src/core/driver.ts:761) serves only component installs (component-installer.ts:607). Today a copy that does not fit runs until cp hits ENOSPC, filling the volume for every other emulator, and is then removed (existing test "removes the device's folder and throws when copying the seed fails").
Simplest fix
Reserve the seed's simlock.avd size against the device root through a DiskSpaceGuard that Seeds owns, released when the copy ends; an unreadable size reserves 0, as today.
constrelease=awaitthis.#copySpace.reserve(this.#filesystem,"android",awaitthis.#filesystem.directorySize(join(fromHome,`${SEED_AVD_NAME}.avd`)).catch(()=>0),this.#deviceRoot);try{/* mkdirp + copyTree as today */}finally{release();}
Tried: reproduction passes; src/drivers/android/, src/leasing/, component-installer.test.ts green (1404 passed).
Alternatives rejected
Wait in the queue instead: a new waiting reason, which is public.
Check only where the copy does not clone (--reflink=always first): a port change and a probe per OS.
Share the installer's guard: it lives in core; drivers never see it.
Risk
On APFS and reflink a clone is free, yet this refuses below the seed's size (3–5 GB).
Through a lease it retries once, then shows PROVISION_FAILED with "to install a android component": the message and errors.mdx need rewording.
Baseline copies (#provisionFromSource) are checked too.
Fast track
Defect: no — a gap; ADR 0061 accepts full copies
Fix tried: yes
Nothing public added or broken: no — refuses leases that clone on APFS/reflink
No ADR or rule changed: yes
One fix: no — wait-vs-refuse and clone-aware check change what users see
Maintainer decision on the triage report (2026-11-20):
Approved as proposed: reserve the seed's full size against the device root before every copy (seed and baseline copies) and refuse with InsufficientDiskSpaceError when it does not fit, on every filesystem. Accepted: a clone on APFS or reflink can be refused when less than the seed's size is free.
Also reword the refusal: the PROVISION_FAILED message must not say "to install a android component" for a seed copy, and errors.mdx follows.
Activity
V3RON commentedon Nov 19, 2026
Reproduction
Gap. ADR 0061 accepts a full copy on ext4 and NTFS; making it cheap there is a decision (a superseding ADR; its Alternatives rule out both drop-ins). What is missing is a free-space check before the copy. The expectation is a proposal: refuse with
InsufficientDiskSpaceError.src/drivers/android/seeds-copies.test.ts, "refuses a copy of the seed that does not fit in the device root's free space before copying, and copies one that fits exactly", onbug/1750-repro:A 4,112-byte seed is copied into a root with 4,111 bytes free; the exact-fit case passes.
Root cause
src/drivers/android/seeds.ts:696-714(#copyAvd) callsfilesystem.copyTreewith no free-space check;DiskSpaceGuard(src/core/driver.ts:761) serves only component installs (component-installer.ts:607). Today a copy that does not fit runs untilcphits ENOSPC, filling the volume for every other emulator, and is then removed (existing test "removes the device's folder and throws when copying the seed fails").Simplest fix
Reserve the seed's
simlock.avdsize against the device root through aDiskSpaceGuardthatSeedsowns, released when the copy ends; an unreadable size reserves 0, as today.Tried: reproduction passes;
src/drivers/android/,src/leasing/,component-installer.test.tsgreen (1404 passed).Alternatives rejected
--reflink=alwaysfirst): a port change and a probe per OS.Risk
PROVISION_FAILEDwith "to install a android component": the message anderrors.mdxneed rewording.#provisionFromSource) are checked too.Fast track
Written by an agent.
V3RON commentedon Nov 20, 2026
Maintainer decision on the triage report (2026-11-20):
Approved as proposed: reserve the seed's full size against the device root before every copy (seed and baseline copies) and refuse with
InsufficientDiskSpaceErrorwhen it does not fit, on every filesystem. Accepted: a clone on APFS or reflink can be refused when less than the seed's size is free.Also reword the refusal: the
PROVISION_FAILEDmessage must not say "to install a android component" for a seed copy, anderrors.mdxfollows.Written by an agent.
fix(android): a seed copy that does not fit in the device root's free…
test: the seed-copy space check gives its reservation back and names …
fix(android): the space check names its own copy, and the docs name t…
chore(seeds): merge origin/main (#1750)
V3RON commentedon Nov 20, 2026
Delivery run
Merged: #1794 (#1750)
Parked: none
Waiting: none
Decided: none
Written by an agent.
fix(android): refuse a seed copy that does not fit in the device root…