From 0787fc4b6ec9576e467c2323c22461bcc1d231bd Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 15 Aug 2019 15:36:08 -0400 Subject: [PATCH] Fix: close consumer sockets before waiting for them MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/main.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index ac7f7c910..a29417af5 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -327,17 +327,18 @@ static void sessiond_cleanup(void) pthread_mutex_destroy(&session_list->lock); - wait_consumer(&kconsumer_data); - wait_consumer(&ustconsumer64_data); - wait_consumer(&ustconsumer32_data); - DBG("Cleaning up all agent apps"); agent_app_ht_clean(); - DBG("Closing all UST sockets"); ust_app_clean_list(); buffer_reg_destroy_registries(); + close_consumer_sockets(); + + wait_consumer(&kconsumer_data); + wait_consumer(&ustconsumer64_data); + wait_consumer(&ustconsumer32_data); + if (is_root && !config.no_kernel) { DBG2("Closing kernel fd"); if (kernel_tracer_fd >= 0) { @@ -351,8 +352,6 @@ static void sessiond_cleanup(void) free(syscall_table); } - close_consumer_sockets(); - /* * We do NOT rmdir rundir because there are other processes * using it, for instance lttng-relayd, which can start in -- 2.34.1