[lttng-dev] [PATCH lttng-tools] Fix: do not flag consumer as disabled on relayd comm failure

Jonathan Rajotte jonathan.rajotte-julien at efficios.com
Thu Jan 25 23:57:27 UTC 2018


Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
---
 src/bin/lttng-sessiond/cmd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c
index a295059..1edcffe 100644
--- a/src/bin/lttng-sessiond/cmd.c
+++ b/src/bin/lttng-sessiond/cmd.c
@@ -920,7 +920,7 @@ static int send_consumer_relayd_socket(enum lttng_domain_type domain,
 	/* Connect to relayd and make version check if uri is the control. */
 	ret = create_connect_relayd(relayd_uri, &rsock, consumer);
 	if (ret != LTTNG_OK) {
-		goto error;
+		goto relayd_comm_error;
 	}
 	assert(rsock);
 
@@ -960,10 +960,6 @@ static int send_consumer_relayd_socket(enum lttng_domain_type domain,
 	 */
 
 close_sock:
-	(void) relayd_close(rsock);
-	free(rsock);
-
-error:
 	if (ret != LTTNG_OK) {
 		/*
 		 * The consumer output for this session should not be used anymore
@@ -972,6 +968,10 @@ error:
 		 */
 		consumer->enabled = 0;
 	}
+	(void) relayd_close(rsock);
+	free(rsock);
+
+relayd_comm_error:
 	return ret;
 }
 
-- 
2.7.4



More information about the lttng-dev mailing list