From 3d3debf9380f066fcef6728cbee52fae4b6ea586 Mon Sep 17 00:00:00 2001 From: cxymds Date: Wed, 16 Sep 2026 07:59:01 +0800 Subject: [PATCH] test(ecstore): drain expiry workers before restart (#7923) --- crates/ecstore/src/store/init.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/ecstore/src/store/init.rs b/crates/ecstore/src/store/init.rs index 3022eec30..c417d0b15 100644 --- a/crates/ecstore/src/store/init.rs +++ b/crates/ecstore/src/store/init.rs @@ -2981,8 +2981,15 @@ mod tests { assert!(backend.contains(&remote).await, "commit must not delete remote bytes before cleanup"); let removed_before = backend.remove_count().await; - // Restart before queue delivery. The new runtime must - // reconstruct ownership solely from the committed xl.meta. + // Later matrix cases reuse this restarted store. If its + // expiry worker has already dequeued this failed cleanup, + // drain it before cancelling the context so the next + // store cannot inherit object locks that block recovery. + wait_for_expiry_workers_idle(&store).await; + + // Restart after the failed cleanup attempt. The new + // runtime must reconstruct ownership from committed + // xl.meta regardless of whether the old queue delivered it. let tier_config = ctx .tier_config_mgr() .read()