@cryptotaxi247 / netdata-1 / commits / 4fe1cb90b

Additional cases for the thread exit fix (#8750)

Andrew Moss committed Apr 17, 2020 at 22:55 UTC 4fe1cb90bf88b131aa9b9cf7d2600277ac94d553
1 file changed +2 -1
aclk/agent_cloud_link.c
+2 -1
@@ -1277,11 +1277,11 @@ static void aclk_try_to_connect(char *hostname, char *port, int port_num)
1277 */
1278 void *aclk_main(void *ptr)
1279 {
1280 + struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
1281 struct netdata_static_thread *query_thread;
1282
1283 if (!netdata_cloud_setting) {
1284 info("Killing ACLK thread -> cloud functionality has been disabled");
1284 - struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
1285 static_thread->enabled = NETDATA_MAIN_THREAD_EXITED;
1286 return NULL;
1287 }
@@ -1300,6 +1300,7 @@ void *aclk_main(void *ptr)
1300 char *cloud_base_url = config_get(CONFIG_SECTION_CLOUD, "cloud base url", DEFAULT_CLOUD_BASE_URL);
1301 if (aclk_decode_base_url(cloud_base_url, &aclk_hostname, &aclk_port)) {
1302 error("Configuration error - cannot use agent cloud link");
1303 + static_thread->enabled = NETDATA_MAIN_THREAD_EXITED;
1304 return NULL;
1305 }
1306 port_num = atoi(aclk_port); // SSL library uses the string, MQTT uses the numeric value