From ea8bcc80ccbb3b7556d226d391189312fdd07321 Mon Sep 17 00:00:00 2001 From: godosa Date: Wed, 7 Oct 2026 19:59:24 +0200 Subject: res: batch gate borrows batch claim; drop queued jobs of dead batch Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01JEAjUkQRrCYX5MZhWxdtj2 --- docs/resource-ledger.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs/resource-ledger.md') diff --git a/docs/resource-ledger.md b/docs/resource-ledger.md index 17a0443..4417517 100644 --- a/docs/resource-ledger.md +++ b/docs/resource-ledger.md @@ -165,6 +165,12 @@ Strict FIFO by `queued`: the head starts when it fits; entries behind a waiting starved); an entry whose lock a running job holds is skipped (it neither starts nor blocks the rest). Starting happens inside every `wf res` call (after prune) and every timer tick. A started queued job runs with the cwd and argv it was queued with; its ETA counts from the actual start. +Batch loan: a job started from inside a live job (`by.batch` = its `WF_RES_ID`, e.g. a `wf batch` worker's gate) +fits against budget + the parent's claim (mem and cpus) minus what the parent's other running children hold, so a +batch waiting for its own gate never deadlocks (direct run and queue alike; not with `--force`). A queued entry +whose parent job ended (done or gone) is dropped at prune (`r-N dropped (batch r-M gone)`, why `owner gone`): +nobody waits for it, and it must not head the queue. + ### 4.3 `wf res status [r-N] [--json]` Without id: one line per entry (id, project, title, state, reserved / used / peak GB, cpus, started, ETA or -- cgit