]> arthur.barton.de Git - netdata.git/commitdiff
make sure disconnected_time is updated before decrementing senders
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Mon, 13 Mar 2017 19:18:19 +0000 (21:18 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Mon, 13 Mar 2017 19:18:19 +0000 (21:18 +0200)
src/rrdpush.c

index 87c4309a2f546d7bff85c195c7d8f707395c0f63..40197a956d30fb72ccb6883ea396fabb74abf9c7 100644 (file)
@@ -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);
     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->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);
 
     }
     rrdhost_unlock(host);