From c3d697df97eddd0dc5eb57213de66ff69b0bab3b Mon Sep 17 00:00:00 2001 From: Thales <46510852+thalesfragoso@users.noreply.github.com> Date: Sun, 3 Oct 2021 22:48:10 -0300 Subject: [PATCH] server: Don't listen for SIGHUP (#389) --- actix-server/CHANGES.md | 5 +++++ actix-server/src/builder.rs | 1 - actix-server/src/signals.rs | 3 --- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/actix-server/CHANGES.md b/actix-server/CHANGES.md index 28c7b206..86cde4f0 100644 --- a/actix-server/CHANGES.md +++ b/actix-server/CHANGES.md @@ -3,8 +3,13 @@ ## Unreleased - 2021-xx-xx * Remove `config` module. `ServiceConfig`, `ServiceRuntime` public types are removed due to this change. [#349] * Remove `ServerBuilder::configure` [#349] +* Server no long listens to SIGHUP signal. + It actually did not take any action when receiving SIGHUP, the only thing SIGHUP did was to stop + the Server from receiving any future signal, because the `Signals` future stops on the first + signal received [#389] [#349]: https://github.com/actix/actix-net/pull/349 +[#389]: https://github.com/actix/actix-net/pull/389 ## 2.0.0-beta.5 - 2021-04-20 diff --git a/actix-server/src/builder.rs b/actix-server/src/builder.rs index e84a887d..46a55ef4 100644 --- a/actix-server/src/builder.rs +++ b/actix-server/src/builder.rs @@ -335,7 +335,6 @@ impl ServerBuilder { completion: None, }) } - _ => (), } } ServerCommand::Notify(tx) => { diff --git a/actix-server/src/signals.rs b/actix-server/src/signals.rs index 0e3cef13..cdd96b9c 100644 --- a/actix-server/src/signals.rs +++ b/actix-server/src/signals.rs @@ -8,8 +8,6 @@ use crate::server::Server; #[allow(dead_code)] #[derive(PartialEq, Clone, Copy, Debug)] pub(crate) enum Signal { - /// SIGHUP - Hup, /// SIGINT Int, /// SIGTERM @@ -41,7 +39,6 @@ impl Signals { let sig_map = [ (unix::SignalKind::interrupt(), Signal::Int), - (unix::SignalKind::hangup(), Signal::Hup), (unix::SignalKind::terminate(), Signal::Term), (unix::SignalKind::quit(), Signal::Quit), ];