mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-07 20:46:11 +00:00
fix(ecstore): capture complete fsync worker guard
(cherry picked from commit 1dc90bb836e20ea9ee45d0a629a9201e20d231c4)
This commit is contained in:
@@ -13459,6 +13459,7 @@ mod test {
|
|||||||
let fence = disk
|
let fence = disk
|
||||||
.snapshot_leases
|
.snapshot_leases
|
||||||
.lock()
|
.lock()
|
||||||
|
.await
|
||||||
.entries
|
.entries
|
||||||
.get(&SnapshotLeaseKey {
|
.get(&SnapshotLeaseKey {
|
||||||
volume: RUSTFS_META_BUCKET.to_string(),
|
volume: RUSTFS_META_BUCKET.to_string(),
|
||||||
|
|||||||
@@ -826,12 +826,13 @@ impl Drop for DstDirFsyncWorkerGuard {
|
|||||||
|
|
||||||
fn run_dst_dir_fsync_group_worker(group: Arc<DstDirFsyncGroup>) -> impl std::future::Future<Output = ()> {
|
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.
|
// Capture before spawning: shutdown may drop the future without polling it.
|
||||||
let mut worker_guard = DstDirFsyncWorkerGuard {
|
let worker_guard = DstDirFsyncWorkerGuard {
|
||||||
group: group.clone(),
|
group: group.clone(),
|
||||||
in_flight: 0,
|
in_flight: 0,
|
||||||
armed: true,
|
armed: true,
|
||||||
};
|
};
|
||||||
async move {
|
async move {
|
||||||
|
let mut worker_guard = worker_guard;
|
||||||
loop {
|
loop {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
fsync_dir_recorder::run_before_group_batch(&group.dir);
|
fsync_dir_recorder::run_before_group_batch(&group.dir);
|
||||||
|
|||||||
Reference in New Issue
Block a user