Feature/cancellation migration (#6014)

* squashing work on using cancellation in nym crates

making nym-task wasm compilable

removed sending of status messages

replaced TaskManager with ShutdownManager in the validator rewarder

additional helpers for ShutdownManager

simplified ShutdownToken by removing the name field

TaskClient => ShutdownToken within all client tasks

wip: remove TaskHandle

* track all long-living client tasks

* add task tracking for most top level tasks within nym-node

* improved default builder

* split up cancellation module

* module documentation and unit tests

* nym node fixes and naming consistency

* wasm fixes

* assert_eq => assert

* wasm fixes and made 'run_until_shutdown' take reference instead of ownership

* linux-specific fixes to IpPacketRouter

* post rebasing fixes for signing monitor

* add ShutdownManager constructor to build it from an external token

* applying PR review suggestions
This commit is contained in:
Jędrzej Stuczyński
2025-09-10 13:56:39 +01:00
committed by GitHub
parent d3cdaf373b
commit 0ee387d983
125 changed files with 2701 additions and 1927 deletions
+4 -5
View File
@@ -190,15 +190,15 @@ impl SignersMonitor {
}
pub(crate) async fn run(&mut self) -> anyhow::Result<()> {
let shutdown_manager =
ShutdownManager::new("nym-signers-monitor").with_default_shutdown_signals()?;
let mut shutdown_manager = ShutdownManager::build_new_default()?;
let root_token = shutdown_manager.clone_shutdown_token();
let mut check_interval = interval(self.check_interval);
while !shutdown_manager.root_token.is_cancelled() {
while !root_token.is_cancelled() {
tokio::select! {
biased;
_ = shutdown_manager.root_token.cancelled() => {
_ = root_token.cancelled() => {
info!("received shutdown");
break;
}
@@ -211,7 +211,6 @@ impl SignersMonitor {
}
}
shutdown_manager.close();
shutdown_manager.run_until_shutdown().await;
if let Err(err) = self.send_shutdown_notification().await {