Firecracker per-bottle run dirs leak → CI runner disk exhaustion #461
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The CI runner (delphi) fills its root filesystem with leaked Firecracker per-bottle
run/<slug>directories (each a ~1Grootfs.ext4), until/hits ~97% and jobs start failing with "no space left on device". One incident had 187 stalesandbox-tester-*dirs = 141 GB.Root causes
launch.py). Each bottle creates itsrun/<slug>dir but only registersstack.callback(vm.terminate)— there is no callback to remove the dir, so every clean exit leaves its rootfs behind.cleanup()is unsafe, so it cannot be used as a GC (cleanup.py). It enumerates every firecracker process + every run dir under the run root, so./cli.py cleanupwould kill running bottles and delete their rootfs — despite being described as orphan cleanup (enumerate_activeis still a stub, #354). Because it is unsafe to run alongside live bottles, it cannot back a periodic sweep.Impact
Root FS exhaustion → CI jobs fail
no space left; requires manualrm -rfof stale run dirs to recover.Fix
shutil.rmtreecallback beforevm.terminate(ExitStack LIFO → VM gone before rootfs removed) so clean teardown reclaims its own dir.cleanup()process-aware: a run dir with a live firecracker process is protected; only dirs with no live process (leaked by a hard-killed launch) are reaped. Safe to run alongside live bottles → can back a periodic GC./var/cache/bot-bottle-fc/run+docker system prune --volumesfor jobs hard-killed before teardown runs.Fixed by #459.