commit ef230d1: [Minor] Do not refork on heartbeat loss if it has not been configured

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Oct 4 14:14:09 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-10-04 14:17:50 +0100
URL: https://github.com/rspamd/rspamd/commit/ef230d1655049e25565b8827f7551a25b13c6293

[Minor] Do not refork on heartbeat loss if it has not been configured

---
 src/libserver/worker_util.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index eff39a8b0..1e03e6976 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -1362,7 +1362,8 @@ rspamd_check_termination_clause (struct rspamd_main *rspamd_main,
 	if (WIFEXITED (res) && WEXITSTATUS (res) == 0) {
 		/* Normal worker termination, do not fork one more */
 
-		if (wrk->hb.nbeats < 0) {
+		if (wrk->hb.nbeats < 0 && rspamd_main->cfg->heartbeats_loss_max > 0 &&
+		        -(wrk->hb.nbeats) >= rspamd_main->cfg->heartbeats_loss_max) {
 			msg_info_main ("%s process %P terminated normally, but lost %L "
 				  "heartbeats, refork it",
 					g_quark_to_string (wrk->type),


More information about the Commits mailing list