Fix: sessiond: erroneous error code returned on rotation failure
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 2 Apr 2020 02:16:32 +0000 (22:16 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 2 Apr 2020 02:16:32 +0000 (22:16 -0400)
`LTTNG_ERR_KERN_CONSUMER_FAIL` is returned by the kernel domain
rotation handling code. This code is associated with a failure to
launch the kernel consumer daemon which is not the case here.

The `LTTNG_ERR_ROTATION_FAIL_CONSUMER` is used instead and returned to
the client.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ifdc9e46addcc4dc7ca2002d6dff5b2d7ac6c31f3

src/bin/lttng-sessiond/kernel.c

index 547d2ec6cafa7567a6a9238f138eb5c15f4012cd..53efad5e79ed0b60dbff2d8d3d9b04319ed12e25 100644 (file)
@@ -1741,7 +1741,7 @@ enum lttng_error_code kernel_rotate_session(struct ltt_session *session)
                                        ksess->uid, ksess->gid, ksess->consumer,
                                        /* is_metadata_channel */ false);
                        if (ret < 0) {
                                        ksess->uid, ksess->gid, ksess->consumer,
                                        /* is_metadata_channel */ false);
                        if (ret < 0) {
-                               status = LTTNG_ERR_KERN_CONSUMER_FAIL;
+                               status = LTTNG_ERR_ROTATION_FAIL_CONSUMER;
                                goto error;
                        }
                }
                                goto error;
                        }
                }
@@ -1753,7 +1753,7 @@ enum lttng_error_code kernel_rotate_session(struct ltt_session *session)
                                ksess->uid, ksess->gid, ksess->consumer,
                                /* is_metadata_channel */ true);
                if (ret < 0) {
                                ksess->uid, ksess->gid, ksess->consumer,
                                /* is_metadata_channel */ true);
                if (ret < 0) {
-                       status = LTTNG_ERR_KERN_CONSUMER_FAIL;
+                       status = LTTNG_ERR_ROTATION_FAIL_CONSUMER;
                        goto error;
                }
        }
                        goto error;
                }
        }
This page took 0.02586 seconds and 4 git commands to generate.