From: Jonathan Rajotte Date: Thu, 25 Jan 2018 23:57:27 +0000 (-0500) Subject: Fix: do not flag consumer as disabled on relayd comm failure X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=9e21835385dae360737a08a6119cf870b68f44f6 Fix: do not flag consumer as disabled on relayd comm failure A relay daemon may be temporarily unavailable (e.g. not launched yet, or simply a network error). In such a case, it is not necessary to mark the consumer as bad since the error is not related to the consumer daemon itself. This change lets the user try to create a channel later without having to restart the session and consumer daemons. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index a295059fb..1edcffe79 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; }