You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1fb65ef
Browse filesBrowse the repository at this point in the historyBrowse files
fix(skills/bounding-heavy-commands): let a whole-queue budget start and keep the tests off the machine's load
A budget of the whole queue could never start. The wait needed the budget plus a headroom of max(1 GiB, a tenth of the memory) free, and the queue already leaves a reserve of max(2 GiB, a quarter of the memory) outside it. On a 27703 MiB machine a budget of the 20480 MiB queue needed about 23250 MiB free, which a machine with a desktop never has, so the command waited forever. headroom_mib now takes the budget and the memory of the queue and never lets the two together need more than the queue, so the headroom shrinks to zero as the budget nears the whole queue and the reserve is the floor for what stays outside.
The tests depended on the load of the real machine. The wrappers that the process tests start, and the in-process bounded() tests, read the real free memory, and with the hard cap they counted the unused budgets of every real bounded-run scope of the user. On a busy machine they waited past their timeouts. The new test-only variable BOUNDED_RUN_FREE_MIB, listed in the usage text with the other values for the tests, gives the wait a fixed free memory and counts no unused budgets. The tests of the counting itself still use fake cgroup trees and do not set it.
Refs #55
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|`--exclusive <name>`| A resource that only one command may hold at a time, such as a fixed port. You choose the name. The wrapper keeps the names of each repository apart, and all worktrees of one repository share them. Repeat the option for each resource. |
44
44
|`--measure`| Also print a suggested budget. Discovery uses it. With no `--memory`, the command runs alone in the queue. |
45
45
46
-
The wrapper does four things in sequence. It waits for its turn in the queue. It waits until the memory of its budget is free. It runs the command. It prints the budget and the measured peak on the error stream. For the wait, the free memory is the memory that the machine has free now, less the part of their budgets that the running bounded commands do not use yet, less a headroom for the programs outside the queue. The headroom is a tenth of the memory of the machine, and at least 1 GiB. The wait has no time limit: the command does not start before its memory is free, and the wrapper prints a line at intervals while it waits. Each line that the wrapper prints starts with `bounded-run:`. Its exit code is the command's exit code. Exit code 125, with a `bounded-run:` line that names a fault and with no line for the budget and the peak, means that the wrapper itself failed (see §When the wrapper cannot run).
46
+
The wrapper does four things in sequence. It waits for its turn in the queue. It waits until the memory of its budget is free. It runs the command. It prints the budget and the measured peak on the error stream. For the wait, the free memory is the memory that the machine has free now, less the part of their budgets that the running bounded commands do not use yet, less a headroom for the programs outside the queue. The headroom is a tenth of the memory of the machine, and at least 1 GiB. The budget and the headroom together never need more than the memory of the queue, so a budget of the whole queue does not wait for a headroom. The wait has no time limit: the command does not start before its memory is free, and the wrapper prints a line at intervals while it waits. Each line that the wrapper prints starts with `bounded-run:`. Its exit code is the command's exit code. Exit code 125, with a `bounded-run:` line that names a fault and with no line for the budget and the peak, means that the wrapper itself failed (see §When the wrapper cannot run).
47
47
48
48
The wrapper sets `BOUNDED_RUN_CPUS` and `BOUNDED_RUN_MEMORY_MIB` in the environment of the command, from `--cpus` and `--memory`. A recorded command line can read them and hand them to the toolchain's own parallelism and memory settings. You do not set them: you change them with the two options.
0 commit comments