From: Julien Desfossez Date: Fri, 29 Sep 2017 19:35:50 +0000 (-0400) Subject: fix rotate pending on relay X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=000cee434afde490d8aa78d7c4ef7419175f77ce;hp=b51c68a41f7737c8dee946af78909bcc53a67e99;p=lttng-tools.git fix rotate pending on relay Signed-off-by: Julien Desfossez --- diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index a296c11e6..bbd4abae6 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -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); diff --git a/src/bin/lttng-sessiond/rotation-thread.c b/src/bin/lttng-sessiond/rotation-thread.c index 58d70510f..b37fb5bd3 100644 --- a/src/bin/lttng-sessiond/rotation-thread.c +++ b/src/bin/lttng-sessiond/rotation-thread.c @@ -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; } diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index f3d074c7c..539543ee9 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -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; } diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index dcce32189..55d792fd1 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -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;