#include <common/common.h>
#include <common/defaults.h>
#include <common/uri.h>
+#include <common/relayd/relayd.h>
#include "consumer.h"
-#include "health.h"
+#include "health-sessiond.h"
#include "ust-app.h"
#include "utils.h"
/* The above call will print a PERROR on error. */
DBG("Error when sending data to consumer on sock %d", fd);
/*
- * At this point, the socket is not usable anymore thus flagging it
- * invalid and closing it.
+ * At this point, the socket is not usable anymore thus closing it and
+ * setting the file descriptor to -1 so it is not reused.
*/
/* This call will PERROR on error. */
/* The above call will print a PERROR on error. */
DBG("Error when receiving data from the consumer socket %d", fd);
/*
- * At this point, the socket is not usable anymore thus flagging it
- * invalid and closing it.
+ * At this point, the socket is not usable anymore thus closing it and
+ * setting the file descriptor to -1 so it is not reused.
*/
/* This call will PERROR on error. */
int overwrite,
unsigned int switch_timer_interval,
unsigned int read_timer_interval,
+ unsigned int live_timer_interval,
int output,
int type,
uint64_t session_id,
msg->u.ask_channel.overwrite = overwrite;
msg->u.ask_channel.switch_timer_interval = switch_timer_interval;
msg->u.ask_channel.read_timer_interval = read_timer_interval;
+ msg->u.ask_channel.live_timer_interval = live_timer_interval;
msg->u.ask_channel.output = output;
msg->u.ask_channel.type = type;
msg->u.ask_channel.session_id = session_id;
int type,
uint64_t tracefile_size,
uint64_t tracefile_count,
- unsigned int monitor)
+ unsigned int monitor,
+ unsigned int live_timer_interval)
{
assert(msg);
msg->u.channel.tracefile_size = tracefile_size;
msg->u.channel.tracefile_count = tracefile_count;
msg->u.channel.monitor = monitor;
+ msg->u.channel.live_timer_interval = live_timer_interval;
strncpy(msg->u.channel.pathname, pathname,
sizeof(msg->u.channel.pathname));
*/
int consumer_send_relayd_socket(struct consumer_socket *consumer_sock,
struct lttcomm_relayd_sock *rsock, struct consumer_output *consumer,
- enum lttng_stream_type type, uint64_t session_id)
+ enum lttng_stream_type type, uint64_t session_id,
+ char *session_name, char *hostname, int session_live_timer)
{
int ret;
struct lttcomm_consumer_msg msg;
goto error;
}
+ if (type == LTTNG_STREAM_CONTROL) {
+ ret = relayd_create_session(rsock,
+ &msg.u.relayd_sock.relayd_session_id,
+ session_name, hostname, session_live_timer,
+ consumer->snapshot);
+ if (ret < 0) {
+ /* Close the control socket. */
+ (void) relayd_close(rsock);
+ goto error;
+ }
+ }
+
msg.cmd_type = LTTNG_CONSUMER_ADD_RELAYD_SOCKET;
/*
* Assign network consumer output index using the temporary consumer since