fix(ecstore): capture complete fsync worker guard

(cherry picked from commit 1dc90bb836e20ea9ee45d0a629a9201e20d231c4)
This commit is contained in:
overtrue
2026-09-06 03:50:30 +08:00
parent 93c89ef132
commit ed100103d0
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -13459,6 +13459,7 @@ mod test {
let fence = disk
.snapshot_leases
.lock()
.await
.entries
.get(&SnapshotLeaseKey {
volume: RUSTFS_META_BUCKET.to_string(),
+2 -1
View File
@@ -826,12 +826,13 @@ impl Drop for DstDirFsyncWorkerGuard {
fn run_dst_dir_fsync_group_worker(group: Arc<DstDirFsyncGroup>) -> impl std::future::Future<Output = ()> {
// 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);