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);
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;
}
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;
}
/* 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) {
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;