@cryptotaxi247 / netdata-1 / commits / da47939df

add information about threads exiting

Costa Tsaousis (ktsaou) committed Sep 27, 2016 at 21:45 UTC da47939df1e7bf6f25dd2d6cf2360d777ab78123
4 files changed +16 -6
src/plugin_proc.c
+3 -1
@@ -63,7 +63,7 @@ void *proc_main(void *ptr)
63 unsigned long long sunext = (time(NULL) - (time(NULL) % rrd_update_every) + rrd_update_every) * 1000000ULL;
64 unsigned long long sunow;
65
66 - for(;1;) {
66 + for(;;) {
67 if(unlikely(netdata_exit)) break;
68
69 // delay until it is our time to run
@@ -241,6 +241,8 @@ void *proc_main(void *ptr)
241 }
242 }
243
244 + info("PROC thread exiting");
245 +
246 pthread_exit(NULL);
247 return NULL;
248 }
src/plugins_d.c
+6 -2
@@ -109,7 +109,7 @@ void *pluginsd_worker_thread(void *arg)
109
110 size_t count = 0;
111
112 - while(likely(1)) {
112 + for(;;) {
113 if(unlikely(netdata_exit)) break;
114
115 FILE *fp = mypopen(cd->cmd, &cd->pid);
@@ -434,6 +434,8 @@ void *pluginsd_worker_thread(void *arg)
434 break;
435 }
436
437 + info("PLUGINSD: '%s' thread exiting", cd->fullfilename);
438 +
439 cd->obsolete = 1;
440 pthread_exit(NULL);
441 return NULL;
@@ -462,7 +464,7 @@ void *pluginsd_main(void *ptr) {
464
465 if(scan_frequency < 1) scan_frequency = 1;
466
465 - while(likely(1)) {
467 + for(;;) {
468 if(unlikely(netdata_exit)) break;
469
470 dir = opendir(dir_name);
@@ -542,6 +544,8 @@ void *pluginsd_main(void *ptr) {
544 sleep((unsigned int) scan_frequency);
545 }
546
547 + info("PLUGINS.D thread exiting");
548 +
549 pthread_exit(NULL);
550 return NULL;
551 }
src/rrd.c
+3 -1
@@ -1387,8 +1387,10 @@ unsigned long long rrdset_done(RRDSET *st)
1387 break;
1388 }
1389
1390 - if(unlikely(!store_this_entry))
1390 + if(unlikely(!store_this_entry)) {
1391 + rd->values[st->current_entry] = pack_storage_number(0, SN_NOT_EXISTS);
1392 continue;
1393 + }
1394
1395 if(likely(rd->updated && rd->counter > 1 && iterations < st->gap_when_lost_iterations_above)) {
1396 rd->values[st->current_entry] = pack_storage_number(new_value, storage_flags );
src/sys_fs_cgroup.c
+4 -2
@@ -1326,7 +1326,7 @@ int do_sys_fs_cgroup(int update_every, unsigned long long dt) {
1326
1327 void *cgroups_main(void *ptr)
1328 {
1329 - if(ptr) { ; }
1329 + (void)ptr;
1330
1331 info("CGROUP Plugin thread created with task id %d", gettid());
1332
@@ -1351,7 +1351,7 @@ void *cgroups_main(void *ptr)
1351
1352 RRDSET *stcpu_thread = NULL;
1353
1354 - for(;1;) {
1354 + for(;;) {
1355 if(unlikely(netdata_exit)) break;
1356
1357 // delay until it is our time to run
@@ -1396,6 +1396,8 @@ void *cgroups_main(void *ptr)
1396 }
1397 }
1398
1399 + info("CGROUP thread exiting");
1400 +
1401 pthread_exit(NULL);
1402 return NULL;
1403 }