commit a742fed: [Minor] Terminate old workers after new workers are spawned

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Sep 2 12:49:12 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-09-02 13:46:00 +0100
URL: https://github.com/rspamd/rspamd/commit/a742fed63c2568df41d718c71944460ffd8ebbda

[Minor] Terminate old workers after new workers are spawned

---
 src/rspamd.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/rspamd.c b/src/rspamd.c
index a67e79165..24ecfaa19 100644
--- a/src/rspamd.c
+++ b/src/rspamd.c
@@ -1115,13 +1115,12 @@ rspamd_hup_handler (struct ev_loop *loop, ev_signal *w, int revents)
 		g_hash_table_foreach (rspamd_main->workers, stop_srv_ev, rspamd_main);
 
 		if (reread_config (rspamd_main)) {
-			msg_info_main ("kill old workers");
-			g_hash_table_foreach (rspamd_main->workers, kill_old_workers, NULL);
-
 			rspamd_check_core_limits (rspamd_main);
 			msg_info_main ("spawn workers with a new config");
 			spawn_workers (rspamd_main, rspamd_main->event_loop);
 			msg_info_main ("workers spawning has been finished");
+			msg_info_main ("kill old workers");
+			g_hash_table_foreach (rspamd_main->workers, kill_old_workers, NULL);
 		}
 		else {
 			/* Reattach old workers */


More information about the Commits mailing list