From 56ec1d12b013f66c39f9081b193fcc1fb6037055 Mon Sep 17 00:00:00 2001 From: joelteply Date: Sun, 1 Nov 2026 01:18:03 -0600 Subject: [PATCH 1/3] CI waits for the freed toolchains only until the cache restore has room #5682 made every Rust job wait for the whole toolchain deletion before restoring the target cache: 66 s on a runner that already had 87G free (warm run 41280912785, ubuntu26 20261026.180.1, 2026-11-01). The restore needs its 29 GB (24 GB unpacked plus the 5 GiB download) on the disk it unpacks onto, so the step now waits only while the deletion runs AND /ci-target has less than 40 GB free; the 19G-free 72G runner that failed #5681 still waits, every roomy runner goes straight on, and the rest of the deletion finishes in the background. The notice reports the wait and /ci-target's room (on 24.04 runners /ci-target is /mnt, where the root deletion frees nothing, so it no longer waits there at all). Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE --- .github/actions/rust-ci-setup/action.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/actions/rust-ci-setup/action.yml b/.github/actions/rust-ci-setup/action.yml index 53cf08d41f..a044053d51 100644 --- a/.github/actions/rust-ci-setup/action.yml +++ b/.github/actions/rust-ci-setup/action.yml @@ -131,14 +131,18 @@ runs: # A 26.04 runner with a 72G disk started with 19G free, and the restore (24 GB unpacked beside # its 5 GiB download) filled it 43 s after the deletion began, still running (#5681's - # continuum-dreaming job, run 41261287633, ubuntu26 20261018.50.1, 2026-11-01 01:32Z). The - # room the deletion makes is only room once it has finished. - - name: Wait for the freed toolchains + # continuum-dreaming job, run 41261287633, ubuntu26 20261018.50.1, 2026-11-01 01:32Z). Waiting + # for the whole deletion cost 66 s on a runner whose 87G was room already (warm run + # 41280912785, ubuntu26 20261026.180.1, 2026-11-01 06:29Z), so the restore waits only until + # the disk it unpacks onto has room for it: the 29 GB it takes plus headroom, 40 GB. The rest + # of the deletion finishes in the background before the build needs it. + - name: Wait until the cache restore has room shell: bash run: | start=$SECONDS - while ps -p "$FREE_TOOLCHAINS_PID" > /dev/null; do sleep 2; done - echo "::notice title=toolchains freed::waited $((SECONDS - start)) s; / free $(df -h --output=avail / | tail -1 | tr -d ' ')" + room() { df --output=avail -B1G /ci-target | tail -1 | tr -d ' '; } + while ps -p "$FREE_TOOLCHAINS_PID" > /dev/null && [ "$(room)" -lt 40 ]; do sleep 2; done + echo "::notice title=room for the restore::waited $((SECONDS - start)) s; /ci-target free $(room)G" - name: Restore the shared target cache id: target-cache From 210c3b031d14da9e64ecce19a9aa2577df92234a Mon Sep 17 00:00:00 2001 From: joelteply Date: Sat, 7 Nov 2026 09:32:04 -0600 Subject: [PATCH 2/3] The restore waits for the room it measured, 29 GB, with no unmeasured headroom Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE --- .github/actions/rust-ci-setup/action.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/actions/rust-ci-setup/action.yml b/.github/actions/rust-ci-setup/action.yml index a044053d51..9744e24592 100644 --- a/.github/actions/rust-ci-setup/action.yml +++ b/.github/actions/rust-ci-setup/action.yml @@ -134,14 +134,15 @@ runs: # continuum-dreaming job, run 41261287633, ubuntu26 20261018.50.1, 2026-11-01 01:32Z). Waiting # for the whole deletion cost 66 s on a runner whose 87G was room already (warm run # 41280912785, ubuntu26 20261026.180.1, 2026-11-01 06:29Z), so the restore waits only until - # the disk it unpacks onto has room for it: the 29 GB it takes plus headroom, 40 GB. The rest - # of the deletion finishes in the background before the build needs it. + # the disk it unpacks onto has the room it takes: 29 GB, its 24 GB unpacked beside its 5 GiB + # download (run 41261287633 above). The rest of the deletion keeps freeing room in the + # background while the restore runs, so the build that follows has it too. - name: Wait until the cache restore has room shell: bash run: | start=$SECONDS room() { df --output=avail -B1G /ci-target | tail -1 | tr -d ' '; } - while ps -p "$FREE_TOOLCHAINS_PID" > /dev/null && [ "$(room)" -lt 40 ]; do sleep 2; done + while ps -p "$FREE_TOOLCHAINS_PID" > /dev/null && [ "$(room)" -lt 29 ]; do sleep 2; done echo "::notice title=room for the restore::waited $((SECONDS - start)) s; /ci-target free $(room)G" - name: Restore the shared target cache From d865fe2ae1635aafedb3c1737ce25994a51bc1cf Mon Sep 17 00:00:00 2001 From: joelteply Date: Wed, 11 Nov 2026 11:50:54 -0600 Subject: [PATCH 3/3] CI's restore wait compares bytes, never df's rounded-up gigabytes (Codex on #5685) df -B1G rounds available blocks up, so 28 GiB + 1 byte printed 29 and skipped the wait. The step now reads df -B1 and waits while /ci-target holds fewer than 29 GiB in bytes; the deletion-ended escape is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE --- .github/actions/rust-ci-setup/action.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/actions/rust-ci-setup/action.yml b/.github/actions/rust-ci-setup/action.yml index 9744e24592..517c00cbd1 100644 --- a/.github/actions/rust-ci-setup/action.yml +++ b/.github/actions/rust-ci-setup/action.yml @@ -141,9 +141,11 @@ runs: shell: bash run: | start=$SECONDS - room() { df --output=avail -B1G /ci-target | tail -1 | tr -d ' '; } - while ps -p "$FREE_TOOLCHAINS_PID" > /dev/null && [ "$(room)" -lt 29 ]; do sleep 2; done - echo "::notice title=room for the restore::waited $((SECONDS - start)) s; /ci-target free $(room)G" + # bytes, never df's rounded-up gigabytes (28 GiB + 1 byte would print 29 and pass; Codex on #5685) + need=$((29 * 1024 * 1024 * 1024)) + room() { df --output=avail -B1 /ci-target | tail -1 | tr -d ' '; } + while ps -p "$FREE_TOOLCHAINS_PID" > /dev/null && [ "$(room)" -lt "$need" ]; do sleep 2; done + echo "::notice title=room for the restore::waited $((SECONDS - start)) s; /ci-target free $(( $(room) / 1024 / 1024 / 1024 )) GiB (needs 29)" - name: Restore the shared target cache id: target-cache