From 6f5a42466137868b3032f7ba4e7a50efef49e96c Mon Sep 17 00:00:00 2001 From: Hare Date: Mon, 26 Oct 2026 19:37:26 +0900 Subject: [PATCH] fix: reclaim stale allocation authority before restoring committed run artifacts --- crates/worker-runtime/src/worker_backend.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/worker-runtime/src/worker_backend.rs b/crates/worker-runtime/src/worker_backend.rs index da734f13a..927e26b1a 100644 --- a/crates/worker-runtime/src/worker_backend.rs +++ b/crates/worker-runtime/src/worker_backend.rs @@ -2922,8 +2922,15 @@ impl ProfileRuntimeWorkerFactory { .map_err(|_| "restore run artifacts cannot be validated")?; let path = worker::runtime::worker_allocation::default_allocation_path() .map_err(|_| "restore allocation authority unavailable")?; - let table = worker::runtime::worker_allocation::LockFileGuard::open(&path) + let mut table = worker::runtime::worker_allocation::LockFileGuard::open(&path) .map_err(|_| "restore allocation authority unavailable")?; + // Activated process death leaves a durable allocation entry. + // Use the same stale-owner authority as normal registration; + // a live or uninspectable owner must still fence reclamation. + worker::runtime::worker_allocation::reclaim_stale(&mut table); + table + .save() + .map_err(|_| "restore stale allocation cleanup unconfirmed")?; if table .data() .find(&Self::runtime_worker_name_for_ref(&request.worker_ref))