From 6e6b202df0bc5f1dbb2546537abfae189013cc3e Mon Sep 17 00:00:00 2001 From: dave horner Date: Mon, 21 Oct 2024 16:33:04 -0400 Subject: [PATCH 1/2] dont wait if force_stop --- crates/core/src/server.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/core/src/server.rs b/crates/core/src/server.rs index b208072e8..13a92d9f6 100644 --- a/crates/core/src/server.rs +++ b/crates/core/src/server.rs @@ -335,7 +335,7 @@ impl Server { } } - if alive_connections.load(Ordering::Acquire) > 0 { + if !force_stop_token.is_cancelled() && alive_connections.load(Ordering::Acquire) > 0 { tracing::info!("wait for all connections to close."); notify.notified().await; } From b739bd924eef1fbc4c02483ba23864b3230c53e8 Mon Sep 17 00:00:00 2001 From: dave horner Date: Mon, 21 Oct 2024 16:44:28 -0400 Subject: [PATCH 2/2] debug --- crates/core/src/server.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/core/src/server.rs b/crates/core/src/server.rs index 13a92d9f6..f79f62724 100644 --- a/crates/core/src/server.rs +++ b/crates/core/src/server.rs @@ -336,7 +336,7 @@ impl Server { } if !force_stop_token.is_cancelled() && alive_connections.load(Ordering::Acquire) > 0 { - tracing::info!("wait for all connections to close."); + tracing::info!("wait for {} connections to close.",alive_connections.load(Ordering::Acquire)); notify.notified().await; }