A job that needs more memory than the machine has while other jobs run would fail for a reason that is not its own. fleetjobs retries it once when memory frees up. When the retry is killed too, or no memory frees up in time, the job goes to the night queue and heavy returns exit 137 with a message that names the job.
Run it
Section titled "Run it"A timer runs the queue at 02:30. Put this in a systemd user timer, or any scheduler you use:
heavy night runIt runs each queued or accepted job in order, in its working directory, as a heavy of its own with HEAVY_NIGHT_RUN=1, so a job killed again is not queued again. Each run keeps its output. A job whose working directory is gone is skipped. A job folder is forgotten 14 days after its last change.
Review it
Section titled "Review it"heavy night list
heavy night show <id>
heavy night accept <id>
heavy night reject <id>list prints one line for each job: its id, state, when it was queued, its folder and its command. show prints its state line and the last 60 lines of its output. A queued job runs unless you reject it; accept marks it as seen, and a rejected job stays out of the run. Neither changes a job that already ran.
The jobs are folders in the store, night/<id>/, with entry.json and out. The entry keeps the job's command and a few variables from its environment: PATH, LANG, LC_*, NODE_OPTIONS, NODE_ENV, CI, VITEST_MAX_WORKERS, COREPACK_*, PNPM_HOME and HEAVY_*.