auto-rebase's disk guard reads an unmeasurable df as zero and silently switches itself off #1651
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1651
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
What is wrong
.forgejo/workflows/auto-rebase.ymlmeasures free space before it checks the repository out, and its own rule is:The code could not honour that. It read the figure into a number inside awk:
int()maps anything it cannot parse to0, so the[!0-9]branch only ever fired whendfprinted nothing at all. Whendfsucceeds but cannot state a figure — a dash orn/ain the Available column, which is what GNUdfprints for a filesystem whosestatvfsit cannot report on (stale autofs/NFS, a container whose lower layer has gone) — the guard read 0 MB free, printed0 MB free, setroom=false, and stood the job down. Green tick, six times an hour, with the rebase switched off and a log line claiming the disk was full.Reproduced, not inferred
The guard step is executed against a
dfthis test controls:Why it matters more than a cosmetic log line
The guard was added by #1508 to stop a full host turning into six red crosses an hour. In this shape it converts the other failure — a
dfthat cannot answer — into a silent outage that reports green, which is the one outcome nobody investigates. The two readings0 MB freeandcould not read the figureare indistinguishable in the log.Fix
Keep the column as
dfprinted it, and apply arithmetic only to a value already proved numeric:a df that cannot say how much room there ismust run the batch; only a numeric reading below the threshold stands the tick down. Asserted behaviourally intest/ci-disk-hygiene.test.js(three cases: unreadable → run, 1 KB → stand down with the reason, failingdf→ run).dfmust not read as zero free space (#1651) #1652