From 470d607350f63f5fabf2f08e8a3f5c00915bb8c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E7=99=BB=E5=B1=B1?= Date: Wed, 2 Sep 2026 09:42:46 +0800 Subject: [PATCH] fix(ecstore): preserve typed target lock errors --- crates/ecstore/src/core/pools.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/ecstore/src/core/pools.rs b/crates/ecstore/src/core/pools.rs index 4a016fd20..cf6c17580 100644 --- a/crates/ecstore/src/core/pools.rs +++ b/crates/ecstore/src/core/pools.rs @@ -986,7 +986,7 @@ fn ensure_decommission_capacity_target_fence( phase: &str, ) -> Result<()> { if guard.is_lock_lost() { - return Err(Error::other(format!( + return Err(Error::DecommissionCapacity(format!( "target pool {target_pool_index} capacity mutation fence was lost during {phase}" ))); } @@ -8463,9 +8463,7 @@ impl ECStore { required, achieved, }), - Err(err) => Err(Error::other(format!( - "failed to acquire target pool {target_pool_index} capacity mutation gate: {err}" - ))), + Err(err) => Err(Error::Lock(err)), } } @@ -8500,9 +8498,7 @@ impl ECStore { required, achieved, }, - other => Error::other(format!( - "failed to acquire target pool {target_pool_index} capacity terminal gate: {other}" - )), + other => Error::Lock(other), })?; guards.push(guard); }