fix(v2): preserve execution cancellation and retry safety

This commit is contained in:
2026-07-27 22:48:08 +02:00
parent 3b7ef2e874
commit bb87b04ca8
2 changed files with 29 additions and 5 deletions
+2 -1
View File
@@ -45,7 +45,8 @@ class Worker:
execution = await claim(db, execution_id, self.owner)
if execution is None:
return False
# M6 supplies source/repository work; this slice proves durable ownership.
# Reload after the claim: a control request can race the lease acquisition.
await db.refresh(execution)
if execution.state == "cancelling":
await complete_cancellation(db, execution.id, self.owner)
return True