From 09111b9bc5057f561a3ba69832bf48fc686ace12 Mon Sep 17 00:00:00 2001 From: Roland Date: Tue, 15 Sep 2026 14:38:38 -0600 Subject: [PATCH] Jobs: _claim_job docstring states the invariant, not the old race Co-Authored-By: Claude Fable 5.1 --- wrolpi/jobs.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wrolpi/jobs.py b/wrolpi/jobs.py index 04d4d9a5..44acb5c0 100644 --- a/wrolpi/jobs.py +++ b/wrolpi/jobs.py @@ -200,10 +200,7 @@ def cancel_job(job_id: str) -> dict: def _claim_job(job_id: str) -> Optional[dict]: """Move a Job from PENDING to RUNNING in one step under the lock; returns the running record, - or None when the Job is no longer pending (cancelled while queued, or already claimed). - - Reading the status and writing RUNNING separately let a cancel land in between and be - overwritten, running a Job the user had cancelled.""" + or None when the Job is no longer pending (cancelled while queued, or already claimed).""" with _lock(): record = _jobs().get(job_id) if not record or record['status'] != PENDING: