@cryptotaxi247 / netdata-1 / commits / 6678fc319

Increase the message size to the spawn server (#17566)

* Spawn server check * Increase message buffer

Stelios Fragkakis committed May 2, 2024 at 07:55 UTC 6678fc3197fa66dd4d574474055732602f46254f
2 files changed +6 -1
src/daemon/commands.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_COMMANDS_H
4 #define NETDATA_COMMANDS_H 1
5
6 -#define MAX_COMMAND_LENGTH 4096
6 +#define MAX_COMMAND_LENGTH (8192)
7 #define MAX_EXIT_STATUS_LENGTH 23 /* Can't ever be bigger than "X-18446744073709551616" */
8
9 typedef enum cmd {
src/daemon/main.c
+5
@@ -23,6 +23,7 @@ int libuv_worker_threads = MIN_LIBUV_WORKER_THREADS;
23 bool ieee754_doubles = false;
24 time_t netdata_start_time = 0;
25 struct netdata_static_thread *static_threads;
26 +bool i_am_the_spawn_server = false;
27
28 struct config netdata_config = {
29 .first_section = NULL,
@@ -303,6 +304,9 @@ static bool service_wait_exit(SERVICE_TYPE service, usec_t timeout_ut) {
304 void web_client_cache_destroy(void);
305
306 void netdata_cleanup_and_exit(int ret, const char *action, const char *action_result, const char *action_data) {
307 + if (i_am_the_spawn_server)
308 + exit(ret);
309 +
310 watcher_shutdown_begin();
311
312 nd_log_limits_unlimited();
@@ -1420,6 +1424,7 @@ int main(int argc, char **argv) {
1424
1425 if (argc > 1 && strcmp(argv[1], SPAWN_SERVER_COMMAND_LINE_ARGUMENT) == 0) {
1426 // don't run netdata, this is the spawn server
1427 + i_am_the_spawn_server = true;
1428 spawn_server();
1429 exit(0);
1430 }