X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=src%2Frrdpush.c;h=72e6d8a737bab8ca32688974b9ed34db1908af6e;hb=8679670bdbe3c5928ec2e266d9c72e1a758fdf37;hp=5b626410c803433aa0efd3958df1619bf9f84e2b;hpb=45b53c3f03d3c8434c317c8332cd9220a37c4974;p=netdata.git diff --git a/src/rrdpush.c b/src/rrdpush.c index 5b626410..72e6d8a7 100644 --- a/src/rrdpush.c +++ b/src/rrdpush.c @@ -59,8 +59,8 @@ int rrdpush_init() { // this is for the first iterations of each chart static unsigned int remote_clock_resync_iterations = 60; -#define rrdpush_lock(host) pthread_mutex_lock(&((host)->rrdpush_mutex)) -#define rrdpush_unlock(host) pthread_mutex_unlock(&((host)->rrdpush_mutex)) +#define rrdpush_lock(host) netdata_mutex_lock(&((host)->rrdpush_mutex)) +#define rrdpush_unlock(host) netdata_mutex_unlock(&((host)->rrdpush_mutex)) // checks if the current chart definition has been sent static inline int need_to_send_chart_definition(RRDSET *st) { @@ -522,7 +522,7 @@ int rrdpush_receive(int fd, const char *key, const char *hostname, const char *m } #ifdef NETDATA_INTERNAL_CHECKS - info("STREAM %s [receive from [%s]:%s]: client willing to stream metrics for host '%s' with machine_guid '%s': update every = %d, history = %d, memory mode = %s, health %s" + info("STREAM %s [receive from [%s]:%s]: client willing to stream metrics for host '%s' with machine_guid '%s': update every = %d, history = %ld, memory mode = %s, health %s" , hostname , client_ip , client_port @@ -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);