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:55:22 +0000 (14:55 -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 a295059fbf487ef237e97d31ffccbd9fb248fdd1..1edcffe79ce13552d688638162068f8085016a1a 100644 (file)
@@ -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;
 }
 
This page took 0.036476 seconds and 4 git commands to generate.