fix rotate pending on relay
authorJulien Desfossez <jdesfossez@efficios.com>
Fri, 29 Sep 2017 19:35:50 +0000 (15:35 -0400)
committerJulien Desfossez <jdesfossez@efficios.com>
Fri, 29 Sep 2017 19:35:50 +0000 (15:35 -0400)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
src/bin/lttng-relayd/main.c
src/bin/lttng-sessiond/rotation-thread.c
src/common/kernel-consumer/kernel-consumer.c
src/common/ust-consumer/ust-consumer.c

index a296c11e696bf99bb67f518e8ddde66c646a23f4..bbd4abae633af702ac59a53c958dabcb2c23ccf2 100644 (file)
@@ -2530,6 +2530,7 @@ int relay_rotate_pending(struct lttcomm_relayd_hdr *recv_hdr,
        rcu_read_unlock();
 
 send_reply:
+       fprintf(stderr, "Rotate pending done: %d\n", rotate_pending);
        memset(&reply, 0, sizeof(reply));
        reply.ret_code = htobe32(rotate_pending);
        ret = conn->sock->ops->sendmsg(conn->sock, &reply, sizeof(reply), 0);
index 58d70510fe52b17a647df5502bf3da5efeda1d2d..b37fb5bd381aacbed546e6d942c62b747ea870c4 100644 (file)
@@ -482,7 +482,12 @@ int handle_rotate_timer_pipe(int fd, uint32_t revents,
        if (!session) {
                ERR("[rotation-thread] Session %" PRIu64 " not found",
                                timer_data.session_id);
-               ret = -1;
+               /*
+                * This is a non-fatal error, and we cannot report it to the
+                * user (timer), so just print the error and continue the
+                * processing.
+                */
+               ret = 0;
                goto end_unlock;
        }
 
index f3d074c7c606748f133719a5163d341ebcc04a30..539543ee929b5c2a60a32ade301e090b0734e564 100644 (file)
@@ -1199,7 +1199,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                                msg.u.rotate_pending_relay.session_id,
                                msg.u.rotate_pending_relay.relayd_id,
                                msg.u.rotate_pending_relay.chunk_id);
-               if (ret < 0) {
+               if (pending < 0) {
                        ERR("Rotate pending relay failed");
                        ret_code = LTTCOMM_CONSUMERD_CHAN_NOT_FOUND;
                }
index dcce32189d86d9411757ea8ef37df8e4e3961af2..55d792fd14bf24de51b274d1ac1274dfbb20044e 100644 (file)
@@ -1990,23 +1990,24 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                        /* Somehow, the session daemon is not responding anymore. */
                        goto end_nosignal;
                }
-
+               break;
        }
        case LTTNG_CONSUMER_ROTATE_PENDING_RELAY:
        {
+               uint32_t pending;
+
                DBG("Consumer rotate pending on relay for session %" PRIu64,
                                msg.u.rotate_pending_relay.session_id);
-               ret = lttng_consumer_rotate_pending_relay(
+               pending = lttng_consumer_rotate_pending_relay(
                                msg.u.rotate_pending_relay.session_id,
                                msg.u.rotate_pending_relay.relayd_id,
                                msg.u.rotate_pending_relay.chunk_id);
-               if (ret < 0) {
+               if (pending < 0) {
                        ERR("Rotate pending relay failed");
                        ret_code = LTTCOMM_CONSUMERD_CHAN_NOT_FOUND;
                }
 
                health_code_update();
-               ret_code = ret;
 
                ret = consumer_send_status_msg(sock, ret_code);
                if (ret < 0) {
@@ -2014,6 +2015,13 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                        goto end_nosignal;
                }
 
+               /* Send back returned value to session daemon */
+               ret = lttcomm_send_unix_sock(sock, &pending, sizeof(pending));
+               if (ret < 0) {
+                       PERROR("send data pending ret code");
+                       goto error_fatal;
+               }
+               break;
        }
        default:
                break;
This page took 0.031214 seconds and 5 git commands to generate.