Repository navigation
Print the macOS host's memory, swap and disk state in Fast test (arm_darwin) - #124316
alexey-milovidov merged 5 commits into
Conversation
…win) The macOS runners fill their 100G EBS boot container again (Code 243 NOT_ENOUGH_SPACE, e.g. job 112074232546 on ClickHouse#122138 started with / 97% full). The job logs show the growth is host state outside the job workspace: the same jobs leave almost nothing behind on some hosts and 0.6-0.75 GB per job on others, and only a reboot (same instance id) resets a host to 43-45%. No host went back to that level between 2026-09-28 and 2026-10-04, although runner-init v77 (ClickHouse#121990) gives macOS runners a 3-day lifetime. GNU df on APFS prints one container-wide number for every volume, so the existing df -h output cannot say what grows, and the hosts cannot be inspected directly. Print, at job start (what earlier jobs left behind) and at job end: uptime, boot time, memory size, swap usage, memory pressure level, the provisioned and running runner-init versions, the swap files, Capacity Consumed per APFS volume, deleted-but-open regular files with their holders, and the 10 largest processes by memory. At job start, when the data volume is at least 60% used, also list directories of 1 GiB or more (healthy hosts sit at 42-50%, so this only runs on a filling host). Everything is read-only. diskutil, lsof and du run under GNU timeout (30, 60, 120 s; gnubin is first in the macOS job PATH), outside sudo so that sudo's secure_path does not hide it; sudo -n never prompts; listings are head-bounded. The test exit code is captured before the end call and the teardown still always runs (no set -e). The wrapper is in darwin_fast_test_digest_config, so a change to it runs the job, and this commit's own CI samples one host. The fix for whatever the output names follows separately. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A timed-out or refused `lsof` printed `0 files`, and a timed-out `du` printed a partial list with no marker; print each collector's exit status (124 = timed out). Co-Authored-By: Claude Opus 5.5 <[email protected]>
lsof prints one row per descriptor, so a file held by several descriptors or processes was summed and listed more than once. Key the count, the total and the listing by device and inode, and also print the number of descriptors. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 2 findings over 3 rounds, 0 in the last) plus my own cold review (5 nits).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261006-205300 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-7:20261006-203200 |
|
Workflow [PR], commit [da4ffb4] Summary: ✅ AI ReviewSummaryThis PR adds start/end host-state diagnostics to Findings
Final Verdict❌ Changes requested — please redact or privatize the host-wide |
Address review: with `+L1`, `lsof` prints an `NLINK` column, so `$9` is the inode `NODE`, not the first token of `NAME`. The dedup is already by device and inode. Co-Authored-By: Claude Opus 5.5 <[email protected]>
| local deleted lsof_rc | ||
| deleted=$(timeout 60 sudo -n lsof -nP +L1 2>/dev/null | awk '$5 == "REG"'; exit "${PIPESTATUS[0]}") | ||
| lsof_rc=$? | ||
| echo "$deleted" | awk -v rc="$lsof_rc" 'NF {d++} NF && !seen[$6 " " $9]++ {n++; s += $7} END {printf "open but deleted files: %d (%d descriptors), %.1f GiB (lsof exit status %d)\n", n, d, s / 2^30, rc}' |
There was a problem hiding this comment.
ps -axm -o ... ,command here, together with the adjacent deleted-file and du dumps, sends raw host-wide argv/path data from a reused self-hosted runner into a public PR log. The whole point of this probe is to inspect leftovers from earlier jobs, so this can disclose unrelated workspaces, deleted filenames, or even command-line secrets from another workload on the same host. Please keep only aggregate data in the public log (counts/sizes, process names via comm, etc.) and move any detailed paths / argv to a private artifact instead.
Related: #122138
Related: #113605
Related: #121990
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
This PR adds diagnostics, not the fix:
Fast test (arm_darwin)now prints what fills the macOS runners' disk.On #122138, the job started with
/97% full (3.6G free), and03312_squashing_with_low_card_mem_usagefailed withCannot reserve 317.82 MiB, not enough space. There were 7 such failures on 5 PRs and 3 hosts on 2026-10-06 (asked for in #122138 (comment)).What grows is host state outside the job workspace: the same jobs leave almost nothing behind on some hosts and 0.6-0.75 GB per job on others, and only a reboot clears it. In the sampled job logs,
ip-10-0-41-191stayed above 50% from 2026-09-28 until it was full on 2026-10-06 (no reboot for 7 days), although #121990 gives macOS runners a 3-day lifetime.dfprints one container-wide number for every APFS volume, so the existingdf -houtput cannot tell what grows.ci/jobs/scripts/fast_test_darwin.shnow prints at job start and end: uptime, boot time, memory size, swap usage and memory pressure level; the provisioned and running runner-init versions; the swap files;Capacity Consumedper APFS volume; deleted-but-open files, each counted once, with a holding process; and the 10 largest processes by memory. At job start, when the data volume is at least 60% full, it also lists directories of 1 GiB or more. Every command is read-only;diskutil,lsofanddurun undertimeoutand print their exit status, so a timed-out collector is visible. The job's exit code is still the test's.Validation: a stub harness runs the real wrapper (also under bash 3.2 and BWK awk, as on macOS). It checks the exit code (0, 1, 137) with failing or hanging diagnostics, the printed collector statuses, the 60% gate and the output bounds. The wrapper is in the darwin job digest, so this PR's own CI prints the state of one host.
Workflow [PR]
Sync PR [sync-upstream/pr/124316]
Version info
26.10.1.1788-master(included in26.10and later)