commit 5995e6b: [Minor] Another heartbeat race

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Sep 16 15:35:07 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-09-16 16:28:49 +0100
URL: https://github.com/rspamd/rspamd/commit/5995e6b8dba5bbe338999419fa232fe664f27ecb

[Minor] Another heartbeat race

---
 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 f6fef8df5..58d75da5d 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -722,7 +722,8 @@ rspamd_main_heartbeat_cb (EV_P_ ev_timer *w, int revents)
 	time_from_last -= wrk->hb.last_event;
 	rspamd_main = wrk->srv;
 
-	if (time_from_last > 0 &&
+	if (wrk->hb.last_event > 0 &&
+		time_from_last > 0 &&
 		time_from_last >= rspamd_main->cfg->heartbeat_interval * 2) {
 
 		rspamd_localtime (wrk->hb.last_event, &tm);


More information about the Commits mailing list