diff --git a/ntex-server/CHANGES.md b/ntex-server/CHANGES.md index 457cf588..000f1743 100644 --- a/ntex-server/CHANGES.md +++ b/ntex-server/CHANGES.md @@ -1,5 +1,9 @@ # Changes +## [2.6.1] - 2024-12-26 + +* Tune shutdown logging + ## [2.6.0] - 2024-12-04 * Use updated Service trait diff --git a/ntex-server/Cargo.toml b/ntex-server/Cargo.toml index 65aec6c7..61c3160f 100644 --- a/ntex-server/Cargo.toml +++ b/ntex-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ntex-server" -version = "2.6.0" +version = "2.6.1" authors = ["ntex contributors "] description = "Server for ntex framework" keywords = ["network", "framework", "async", "futures"] diff --git a/ntex-server/src/manager.rs b/ntex-server/src/manager.rs index e9c736c3..ae0f7974 100644 --- a/ntex-server/src/manager.rs +++ b/ntex-server/src/manager.rs @@ -262,10 +262,10 @@ impl HandleCmdState { for tx in notify { let _ = tx.send(()); } + sleep(STOP_DELAY).await; // stop system if server was spawned if self.mgr.0.cfg.stop_runtime { - sleep(STOP_DELAY).await; System::current().stop(); } } diff --git a/ntex-server/src/net/accept.rs b/ntex-server/src/net/accept.rs index 4d1d5a85..a9a588b2 100644 --- a/ntex-server/src/net/accept.rs +++ b/ntex-server/src/net/accept.rs @@ -215,13 +215,13 @@ impl Accept { for info in self.sockets.drain(..) { info.sock.remove_source() } + log::info!("Accept loop has been stopped"); if let Some(rx) = rx { thread::sleep(EXIT_TIMEOUT); let _ = rx.send(()); } - log::trace!("Accept loop has been stopped"); break; } } @@ -295,25 +295,25 @@ impl Accept { Ok(cmd) => match cmd { AcceptorCommand::Stop(rx) => { if !self.backpressure { - log::trace!("Stopping accept loop"); + log::info!("Stopping accept loop"); self.backpressure(true); } break Either::Right(Some(rx)); } AcceptorCommand::Terminate => { - log::trace!("Stopping accept loop"); + log::info!("Stopping accept loop"); self.backpressure(true); break Either::Right(None); } AcceptorCommand::Pause => { if !self.backpressure { - log::trace!("Pausing accept loop"); + log::info!("Pausing accept loop"); self.backpressure(true); } } AcceptorCommand::Resume => { if self.backpressure { - log::trace!("Resuming accept loop"); + log::info!("Resuming accept loop"); self.backpressure(false); } } @@ -322,13 +322,14 @@ impl Accept { } }, Err(err) => { + log::error!("Dropping accept loop"); break match err { mpsc::TryRecvError::Empty => Either::Left(()), mpsc::TryRecvError::Disconnected => { self.backpressure(true); Either::Right(None) } - } + }; } } }