@cryptotaxi247 / netdata-1 / commits / 10049a05d

attempt to fix exit procedure on alpine

Costa Tsaousis (ktsaou) committed Sep 27, 2016 at 21:55 UTC 10049a05d1e6eb64773e395121c7f2503624c635
1 file changed +4 -12
src/plugins_d.c
+4 -12
@@ -380,16 +380,9 @@ void *pluginsd_worker_thread(void *arg)
380
381 // get the return code
382 int code = mypclose(fp, cd->pid);
383 -
384 - if(netdata_exit) {
385 - cd->pid = 0;
386 - cd->enabled = 0;
387 - cd->obsolete = 1;
388 - pthread_exit(NULL);
389 - return NULL;
390 - }
391 -
392 - if(code != 0) {
383 +
384 + if(unlikely(netdata_exit)) break;
385 + else if(code != 0) {
386 // the plugin reports failure
387
388 if(likely(!cd->successful_collections)) {
@@ -430,8 +423,7 @@ void *pluginsd_worker_thread(void *arg)
423 }
424 cd->pid = 0;
425
433 - if(unlikely(!cd->enabled))
434 - break;
426 + if(unlikely(!cd->enabled)) break;
427 }
428
429 info("PLUGINSD: '%s' thread exiting", cd->fullfilename);