diff options
author | thiagoftsm <thiagoftsm@gmail.com> | 2020-05-25 14:27:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-25 14:27:27 +0000 |
commit | 4fb41597da6961813679c1b795793600ddc0a402 (patch) | |
tree | 4b00b831bd6fd48a1fdd069fb4f86ee29ea4a18f /exporting/send_data.c | |
parent | 6c4da08ece22cc6233ad01a9e899f13b1477055c (diff) |
Exporting cleanup (#9098)
Cleanup allocated variables for the majority of the databases.
Diffstat (limited to 'exporting/send_data.c')
-rw-r--r-- | exporting/send_data.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/exporting/send_data.c b/exporting/send_data.c index 3a749cdbb8..8c579d8fce 100644 --- a/exporting/send_data.c +++ b/exporting/send_data.c @@ -149,7 +149,8 @@ void simple_connector_cleanup(struct instance *instance) { info("EXPORTING: cleaning up instance %s ...", instance->config.name); - // TODO free allocated resources + buffer_free(instance->buffer); + freez(instance->config.connector_specific_config); info("EXPORTING: instance %s exited", instance->config.name); instance->exited = 1; @@ -218,7 +219,10 @@ void simple_connector_worker(void *instance_p) uv_mutex_lock(&instance->mutex); uv_cond_wait(&instance->cond_var, &instance->mutex); - if(unlikely(instance->engine->exit)) break; + if (unlikely(instance->engine->exit)) { + uv_mutex_unlock(&instance->mutex); + break; + } if (likely(sock != -1)) { simple_connector_send_buffer(&sock, &failures, instance); @@ -252,9 +256,14 @@ void simple_connector_worker(void *instance_p) uv_mutex_unlock(&instance->mutex); #ifdef UNIT_TESTING - break; + return; #endif } +#if ENABLE_PROMETHEUS_REMOTE_WRITE + if (instance->config.type == EXPORTING_CONNECTOR_TYPE_PROMETHEUS_REMOTE_WRITE) + clean_prometheus_remote_write(instance); +#endif + simple_connector_cleanup(instance); } |