@cryptotaxi247 / netdata-1 / commits / 6fb41a568

send quit to plugins (#19166)

* send quit to plugins * add a log about sending QUIT * turn log into debug log

Costa Tsaousis committed Dec 9, 2024 at 16:15 UTC 6fb41a5681d4fae52376244d72421931a3b56e41
1 file changed +9 -3
src/plugins.d/pluginsd_parser.c
+9 -3
@@ -1232,8 +1232,9 @@ inline size_t pluginsd_process(RRDHOST *host, struct plugind *cd, int fd_input,
1232 2 * 60 * MSEC_PER_SEC, true);
1233
1234 if(unlikely(ret != BUFFERED_READER_READ_OK)) {
1235 - nd_log(NDLS_COLLECTORS, NDLP_INFO, "Buffered reader not OK");
1236 - send_quit = false;
1235 + nd_log(NDLS_COLLECTORS, NDLP_INFO, "PLUGINSD: buffered reader not OK (%u)", (unsigned)ret);
1236 + if(ret == BUFFERED_READER_READ_POLLERR || ret == BUFFERED_READER_READ_POLLHUP)
1237 + send_quit = false;
1238 break;
1239 }
1240
@@ -1247,8 +1248,13 @@ inline size_t pluginsd_process(RRDHOST *host, struct plugind *cd, int fd_input,
1248 buffer->buffer[0] = '\0';
1249 }
1250
1250 - if(send_quit)
1251 + if(send_quit) {
1252 + nd_log(NDLS_COLLECTORS, NDLP_DEBUG,
1253 + "PLUGINSD: sending '"PLUGINSD_CALL_QUIT"' to plugin: %s",
1254 + string2str(cd->filename));
1255 +
1256 send_to_plugin(PLUGINSD_CALL_QUIT, parser, STREAM_TRAFFIC_TYPE_METADATA);
1257 + }
1258
1259 cd->unsafe.enabled = parser->user.enabled;
1260 count = parser->user.data_collections_count;