From ed100103d03e71aa4b8f7da3ae24a28b2caf2bbc Mon Sep 17 00:00:00 2001 From: overtrue Date: Sun, 6 Sep 2026 03:50:30 +0800 Subject: [PATCH] fix(ecstore): capture complete fsync worker guard (cherry picked from commit 1dc90bb836e20ea9ee45d0a629a9201e20d231c4) --- crates/ecstore/src/disk/local.rs | 1 + crates/ecstore/src/disk/os.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ecstore/src/disk/local.rs b/crates/ecstore/src/disk/local.rs index 969ce16be..e285d6a4b 100644 --- a/crates/ecstore/src/disk/local.rs +++ b/crates/ecstore/src/disk/local.rs @@ -13459,6 +13459,7 @@ mod test { let fence = disk .snapshot_leases .lock() + .await .entries .get(&SnapshotLeaseKey { volume: RUSTFS_META_BUCKET.to_string(), diff --git a/crates/ecstore/src/disk/os.rs b/crates/ecstore/src/disk/os.rs index e1e7044c6..c9df5b874 100644 --- a/crates/ecstore/src/disk/os.rs +++ b/crates/ecstore/src/disk/os.rs @@ -826,12 +826,13 @@ impl Drop for DstDirFsyncWorkerGuard { fn run_dst_dir_fsync_group_worker(group: Arc) -> impl std::future::Future { // Capture before spawning: shutdown may drop the future without polling it. - let mut worker_guard = DstDirFsyncWorkerGuard { + let worker_guard = DstDirFsyncWorkerGuard { group: group.clone(), in_flight: 0, armed: true, }; async move { + let mut worker_guard = worker_guard; loop { #[cfg(test)] fsync_dir_recorder::run_before_group_batch(&group.dir);