]> arthur.barton.de Git - netdata.git/commitdiff
add information about threads exiting
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Tue, 27 Sep 2016 18:45:26 +0000 (21:45 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Tue, 27 Sep 2016 18:45:26 +0000 (21:45 +0300)
src/plugin_proc.c
src/plugins_d.c
src/rrd.c
src/sys_fs_cgroup.c

index 3c57b66bb72b8bf3f018ffcbc34ff19cc91dae01..a50a2251463bc5b49a73398292669348798cee79 100644 (file)
@@ -63,7 +63,7 @@ void *proc_main(void *ptr)
     unsigned long long sunext = (time(NULL) - (time(NULL) % rrd_update_every) + rrd_update_every) * 1000000ULL;
     unsigned long long sunow;
 
-    for(;1;) {
+    for(;;) {
         if(unlikely(netdata_exit)) break;
 
         // delay until it is our time to run
@@ -241,6 +241,8 @@ void *proc_main(void *ptr)
         }
     }
 
+    info("PROC thread exiting");
+
     pthread_exit(NULL);
     return NULL;
 }
index 55ccd544389f092abe849625d51487a373eb03e6..8bcb57f2aa28ecdee944da73889d838525a1716b 100644 (file)
@@ -109,7 +109,7 @@ void *pluginsd_worker_thread(void *arg)
 
     size_t count = 0;
 
-    while(likely(1)) {
+    for(;;) {
         if(unlikely(netdata_exit)) break;
 
         FILE *fp = mypopen(cd->cmd, &cd->pid);
@@ -434,6 +434,8 @@ void *pluginsd_worker_thread(void *arg)
             break;
     }
 
+    info("PLUGINSD: '%s' thread exiting", cd->fullfilename);
+
     cd->obsolete = 1;
     pthread_exit(NULL);
     return NULL;
@@ -462,7 +464,7 @@ void *pluginsd_main(void *ptr) {
 
     if(scan_frequency < 1) scan_frequency = 1;
 
-    while(likely(1)) {
+    for(;;) {
         if(unlikely(netdata_exit)) break;
 
         dir = opendir(dir_name);
@@ -542,6 +544,8 @@ void *pluginsd_main(void *ptr) {
         sleep((unsigned int) scan_frequency);
     }
 
+    info("PLUGINS.D thread exiting");
+
     pthread_exit(NULL);
     return NULL;
 }
index 59b0c9988a9354ed85a116581dce4d2b3a9ab455..14fbbaf638bfcd5ffe8e788ebbd3c10e8f17d5b1 100644 (file)
--- a/src/rrd.c
+++ b/src/rrd.c
@@ -1387,8 +1387,10 @@ unsigned long long rrdset_done(RRDSET *st)
                     break;
             }
 
-            if(unlikely(!store_this_entry))
+            if(unlikely(!store_this_entry)) {
+                rd->values[st->current_entry] = pack_storage_number(0, SN_NOT_EXISTS);
                 continue;
+            }
 
             if(likely(rd->updated && rd->counter > 1 && iterations < st->gap_when_lost_iterations_above)) {
                 rd->values[st->current_entry] = pack_storage_number(new_value, storage_flags );
index 0ffd55e21cef17b14491fd277213d3a771be7830..010af824dbe753f5088558c22e159e8d2b9d99dc 100644 (file)
@@ -1326,7 +1326,7 @@ int do_sys_fs_cgroup(int update_every, unsigned long long dt) {
 
 void *cgroups_main(void *ptr)
 {
-    if(ptr) { ; }
+    (void)ptr;
 
     info("CGROUP Plugin thread created with task id %d", gettid());
 
@@ -1351,7 +1351,7 @@ void *cgroups_main(void *ptr)
 
     RRDSET *stcpu_thread = NULL;
 
-    for(;1;) {
+    for(;;) {
         if(unlikely(netdata_exit)) break;
 
         // delay until it is our time to run
@@ -1396,6 +1396,8 @@ void *cgroups_main(void *ptr)
         }
     }
 
+    info("CGROUP thread exiting");
+
     pthread_exit(NULL);
     return NULL;
 }