From: Mathieu Desnoyers Date: Thu, 15 Aug 2019 19:36:08 +0000 (-0400) Subject: Fix: close consumer sockets before waiting for them X-Git-Tag: v2.12.0-rc1~475 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=0787fc4b6ec9576e467c2323c22461bcc1d231bd Fix: close consumer sockets before waiting for them Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- 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