diff mbox series

[lttng-tools] Fix: close channel monitor pipe after killing the metadata_timer_thread

Message ID 20171012151939.1534-1-jonathan.rajotte-julien@efficios.com
State Accepted, archived
Delegated to: Jérémie Galarneau
Headers show
Series [lttng-tools] Fix: close channel monitor pipe after killing the metadata_timer_thread | expand

Commit Message

Jonathan Rajotte Oct. 12, 2017, 3:19 p.m. UTC
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
---
 src/bin/lttng-consumerd/lttng-consumerd.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

Comments

Jérémie Galarneau Nov. 14, 2017, 12:26 a.m. UTC | #1
Merged, thanks!

Jérémie

On 12 October 2017 at 11:19, Jonathan Rajotte
<jonathan.rajotte-julien at efficios.com> wrote:
> Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
> ---
>  src/bin/lttng-consumerd/lttng-consumerd.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/src/bin/lttng-consumerd/lttng-consumerd.c b/src/bin/lttng-consumerd/lttng-consumerd.c
> index fef03c6f..c0716af2 100644
> --- a/src/bin/lttng-consumerd/lttng-consumerd.c
> +++ b/src/bin/lttng-consumerd/lttng-consumerd.c
> @@ -576,14 +576,6 @@ int main(int argc, char **argv)
>                 PERROR("pthread_join sessiond_thread");
>                 retval = -1;
>         }
> -
> -       ret = consumer_timer_thread_get_channel_monitor_pipe();
> -       if (ret >= 0) {
> -               ret = close(ret);
> -               if (ret) {
> -                       PERROR("close channel monitor pipe");
> -               }
> -       }
>  exit_sessiond_thread:
>
>         ret = pthread_join(data_thread, &status);
> @@ -650,6 +642,13 @@ exit_init_data:
>                         PERROR("pthread_join metadata_timer_thread");
>                         retval = -1;
>                 }
> +               ret = consumer_timer_thread_get_channel_monitor_pipe();
> +               if (ret >= 0) {
> +                       ret = close(ret);
> +                       if (ret) {
> +                               PERROR("close channel monitor pipe");
> +                       }
> +               }
>                 metadata_timer_thread_online = false;
>         }
>         tmp_ctx = ctx;
> --
> 2.11.0
>
diff mbox series

Patch

diff --git a/src/bin/lttng-consumerd/lttng-consumerd.c b/src/bin/lttng-consumerd/lttng-consumerd.c
index fef03c6f..c0716af2 100644
--- a/src/bin/lttng-consumerd/lttng-consumerd.c
+++ b/src/bin/lttng-consumerd/lttng-consumerd.c
@@ -576,14 +576,6 @@  int main(int argc, char **argv)
 		PERROR("pthread_join sessiond_thread");
 		retval = -1;
 	}
-
-	ret = consumer_timer_thread_get_channel_monitor_pipe();
-	if (ret >= 0) {
-		ret = close(ret);
-		if (ret) {
-			PERROR("close channel monitor pipe");
-		}
-	}
 exit_sessiond_thread:
 
 	ret = pthread_join(data_thread, &status);
@@ -650,6 +642,13 @@  exit_init_data:
 			PERROR("pthread_join metadata_timer_thread");
 			retval = -1;
 		}
+		ret = consumer_timer_thread_get_channel_monitor_pipe();
+		if (ret >= 0) {
+			ret = close(ret);
+			if (ret) {
+				PERROR("close channel monitor pipe");
+			}
+		}
 		metadata_timer_thread_online = false;
 	}
 	tmp_ctx = ctx;