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
}
}
+ info("PROC thread exiting");
+
pthread_exit(NULL);
return NULL;
}
size_t count = 0;
- while(likely(1)) {
+ for(;;) {
if(unlikely(netdata_exit)) break;
FILE *fp = mypopen(cd->cmd, &cd->pid);
// get the return code
int code = mypclose(fp, cd->pid);
-
- if(netdata_exit) {
- cd->pid = 0;
- cd->enabled = 0;
- cd->obsolete = 1;
- pthread_exit(NULL);
- return NULL;
- }
-
- if(code != 0) {
+
+ if(unlikely(netdata_exit)) break;
+ else if(code != 0) {
// the plugin reports failure
if(likely(!cd->successful_collections)) {
}
cd->pid = 0;
- if(unlikely(!cd->enabled))
- break;
+ if(unlikely(!cd->enabled)) break;
}
+ info("PLUGINSD: '%s' thread exiting", cd->fullfilename);
+
cd->obsolete = 1;
pthread_exit(NULL);
return NULL;
if(scan_frequency < 1) scan_frequency = 1;
- while(likely(1)) {
+ for(;;) {
if(unlikely(netdata_exit)) break;
dir = opendir(dir_name);
sleep((unsigned int) scan_frequency);
}
+ info("PLUGINS.D thread exiting");
+
pthread_exit(NULL);
return NULL;
}
debug(D_EXIT, "Request to mypclose() on pid %d", pid);
/*mypopen_del(fp);*/
+
+ // close the pipe fd
+ // this is required in musl
+ // without it the childs do not exit
+ close(fileno(fp));
+
+ // close the pipe file pointer
fclose(fp);
siginfo_t info;
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 );
void *cgroups_main(void *ptr)
{
- if(ptr) { ; }
+ (void)ptr;
info("CGROUP Plugin thread created with task id %d", gettid());
RRDSET *stcpu_thread = NULL;
- for(;1;) {
+ for(;;) {
if(unlikely(netdata_exit)) break;
// delay until it is our time to run
}
}
+ info("CGROUP thread exiting");
+
pthread_exit(NULL);
return NULL;
}