From 624453e37c38087e8101a2e0d6d25886194aeea7 Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Tue, 20 Feb 2024 00:16:09 +0200 Subject: [PATCH] Fix legacy sync pausing code --- crates/subspace-service/src/sync_from_dsn.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/subspace-service/src/sync_from_dsn.rs b/crates/subspace-service/src/sync_from_dsn.rs index dd261061cb..9243ddafc3 100644 --- a/crates/subspace-service/src/sync_from_dsn.rs +++ b/crates/subspace-service/src/sync_from_dsn.rs @@ -249,9 +249,8 @@ where .saturating_sub(chain_constants.confirmation_depth_k().into()); let segment_header_downloader = SegmentHeaderDownloader::new(node); - let mut initial_pause_sync = Some(pause_sync.load(Ordering::Acquire)); while let Some(reason) = notifications.next().await { - let prev_pause_sync = pause_sync.swap(true, Ordering::AcqRel); + pause_sync.store(true, Ordering::Release); info!(?reason, "Received notification to sync from DSN"); // TODO: Maybe handle failed block imports, additional helpful logging @@ -295,10 +294,7 @@ where } } - pause_sync.store( - initial_pause_sync.take().unwrap_or(prev_pause_sync), - Ordering::Release, - ); + pause_sync.store(false, Ordering::Release); while notifications.try_next().is_ok() { // Just drain extra messages if there are any