ci: an unreadable df must not read as zero free space (#1651) #1652
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1652
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/1116-1105"
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?
Fixes #1651
The disk guard added by #1508 kept the number awk had already parsed:
int()maps anything it cannot parse to0, so adfthat succeeds but cannot state a figure — the dash orn/aGNUdfprints in the Available column of a filesystem it cannot measure (stale autofs/NFS, a container whose lower layer is gone) — became a reading of 0 MB free. The guard then printed0 MB free, setroom=false, and stood the job down: green tick, six times an hour, rebase switched off, and a log line claiming the disk was full. The''|*[!0-9]*branch that says "unmeasurable runs the batch" was unreachable onceint()had run, so the comment above it was documentation of behaviour the code did not have.Change
Keep the column exactly as
dfprinted it; apply arithmetic only to a value already proved numeric:Side effect: a genuinely tight disk now reports
1 MB freewhere the truncation used to print0 MB free.Test
test/ci-disk-hygiene.test.jsgained three cases that execute the step, against adfthe test owns — reading it as text cannot distinguish0 MB freefromcould not read the figure, which is the whole defect:dfanswersn/ain Availableroom=true(wasroom=false)1KB availableroom=false::error title=Not enough disk::… see #1507room=trueFirst case reproduced
room=falsebefore the fix. The harness skips on a host with nobash, since the step only ever runs on a Linux runner.Gates
No engine or shared code touched, so no full-suite run. Workflow still parses as YAML with the block scalar intact (checked with PyYAML, 52-line guard body).
One thing this does not fix: the guard's fail-open policy is still the same one — a
dfthat answers nothing runs the batch. That is deliberate per #1508, but it means a runner whosedfis broken will spend bytes it was meant to protect. Reported to Jay rather than changed here.dfmust not read as zero free space (#1651)8f572fbded218f63f66d