_AC_DEFINE_QUOTED_AND_SUBST([DEFAULT_NETWORK_CONTROL_BIND_ADDRESS], [0.0.0.0])
_AC_DEFINE_QUOTED_AND_SUBST([DEFAULT_NETWORK_DATA_BIND_ADDRESS], [0.0.0.0])
_AC_DEFINE_QUOTED_AND_SUBST([DEFAULT_NETWORK_VIEWER_BIND_ADDRESS], [localhost])
+_AC_DEFINE_AND_SUBST([DEFAULT_ROTATE_PENDING_RELAY_TIMER], [500000])
# Command short descriptions
_AC_DEFINE_QUOTED_AND_SUBST([CMD_DESCR_ADD_CONTEXT], [Add context fields to a channel])
session->rotate_count++;
session->rotate_pending = true;
+ session->rotate_pending_relay_check_in_progress = false;
session->rotate_status = LTTNG_ROTATE_STARTED;
/*
channel_info->session->rotate_pending = false;
if (channel_info->session->rotate_pending_relay) {
ret = sessiond_timer_rotate_pending_start(
- channel_info->session, 100000);
+ channel_info->session,
+ DEFAULT_ROTATE_PENDING_RELAY_TIMER);
if (ret) {
ERR("Enabling rotate pending timer");
ret = -1;
if (ret == 0) {
DBG("[rotation-thread] Rotation completed on the relay for "
"session %" PRIu64, session_id);
- session->rotate_pending_relay = 0;
+ session->rotate_pending_relay = false;
sessiond_timer_rotate_pending_stop(session);
} else if (ret == 1) {
DBG("[rotation-thread] Rotation still pending on the relay for "
"session %" PRIu64, session_id);
}
+ /*
+ * Allow the timer thread to send other notifications if needed.
+ */
+ session->rotate_pending_relay_check_in_progress = false;
fprintf(stderr, "RET PENDING: %d\n", ret);
ret = 0;
uint64_t rotate_count;
bool rotate_pending;
bool rotate_pending_relay;
+ bool rotate_pending_relay_check_in_progress;
enum lttng_rotate_status rotate_status;
/*
* Number of channels waiting for a rotate.
struct ltt_session *session = si->si_value.sival_ptr;
assert(session);
+ /*
+ * Avoid sending too many requests in case the relay is slower to
+ * respond than the timer period.
+ */
+ if (session->rotate_pending_relay_check_in_progress ||
+ !session->rotate_pending_relay) {
+ goto end;
+ }
+
+ session->rotate_pending_relay_check_in_progress = true;
ret = lttng_write(ctx->rotate_timer_pipe, &session->id,
sizeof(session->id));
if (ret < sizeof(session->id)) {
PERROR("wakeup rotate pipe");
}
+
+end:
+ return;
}
/*
/* Default maximal size of message notification channel message payloads. */
#define DEFAULT_CLIENT_MAX_QUEUED_NOTIFICATIONS_COUNT 100
+/*
+ * Default timer value in usec for the rotate pending polling check on the
+ * relay when a rotation has completed on the consumer.
+ */
+#define DEFAULT_ROTATE_PENDING_RELAY_TIMER CONFIG_DEFAULT_ROTATE_PENDING_RELAY_TIMER
+
/*
* Returns the default subbuf size.
*