From 3869e7eb5d6bbf3d4b78d84e5b36f19a8968971f Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Mon, 13 Mar 2017 21:18:19 +0200 Subject: [PATCH] make sure disconnected_time is updated before decrementing senders --- src/rrdpush.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rrdpush.c b/src/rrdpush.c index 87c4309a..40197a95 100644 --- a/src/rrdpush.c +++ b/src/rrdpush.c @@ -583,12 +583,11 @@ int rrdpush_receive(int fd, const char *key, const char *hostname, const char *m error("STREAM %s [receive from [%s]:%s]: disconnected (completed updates %zu).", host->hostname, client_ip, client_port, count); rrdhost_wrlock(host); + host->senders_disconnected_time = now_realtime_sec(); host->connected_senders--; if(!host->connected_senders) { if(health_enabled == CONFIG_BOOLEAN_AUTO) host->health_enabled = 0; - - host->senders_disconnected_time = now_realtime_sec(); } rrdhost_unlock(host); -- 2.39.2