]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Do not refork on heartbeat loss if it has not been configured
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 4 Oct 2019 13:17:50 +0000 (14:17 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 4 Oct 2019 13:17:50 +0000 (14:17 +0100)
src/libserver/worker_util.c

index eff39a8b074caa8b51c86fa97c8f7d1d53a90d4f..1e03e6976107076ef641709853f9d83f3e3d6b1b 100644 (file)
@@ -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),