Fix: do not flag consumer as disabled on relayd comm failure
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 25 Jan 2018 23:57:27 +0000 (18:57 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 5 Feb 2018 19:58:11 +0000 (14:58 -0500)
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 <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/cmd.c

index fb5f19bdbab6cb19ddc2d07466750a36e1366a9c..ffaf999ab25658954f8ffb9d6ef1958c869b2e6e 100644 (file)
@@ -899,7 +899,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);
 
@@ -939,10 +939,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
@@ -951,6 +947,10 @@ error:
                 */
                consumer->enabled = 0;
        }
+       (void) relayd_close(rsock);
+       free(rsock);
+
+relayd_comm_error:
        return ret;
 }
 
This page took 0.027583 seconds and 4 git commands to generate.