diff options
author | Timotej S <6674623+underhood@users.noreply.github.com> | 2020-06-18 12:46:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-18 12:46:04 +0200 |
commit | 5bc76f3b5bbba126c5bc651f4ada897c6ae05a94 (patch) | |
tree | 5edd485008aa93ffcef2d147282f19bc583e76e8 /aclk/agent_cloud_link.c | |
parent | 3a48d7d3995917ad6e5e16b8e10a06a721cc82dc (diff) |
Fixed ACLK shutdown sequence (#9367)
* fix aclk shutdown sequence
Diffstat (limited to 'aclk/agent_cloud_link.c')
-rw-r--r-- | aclk/agent_cloud_link.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/aclk/agent_cloud_link.c b/aclk/agent_cloud_link.c index 7b5aad5c4a..a12c51cf9e 100644 --- a/aclk/agent_cloud_link.c +++ b/aclk/agent_cloud_link.c @@ -1063,9 +1063,6 @@ static void aclk_main_cleanup(void *ptr) QUERY_THREAD_WAKEUP; aclk_graceful_disconnect(); } - - - static_thread->enabled = NETDATA_MAIN_THREAD_EXITED; } struct dictionary_singleton { @@ -1538,6 +1535,13 @@ exited: freez(stats_thread); } + /* + * this must be last -> if all static threads signal + * THREAD_EXITED rrdengine will dealloc the RRDSETs + * and RRDDIMs that are used by still runing stat thread. + * see netdata_cleanup_and_exit() for reference + */ + static_thread->enabled = NETDATA_MAIN_THREAD_EXITED; return NULL; } |