config for pending timer + rate limiting
[deliverable/lttng-tools.git] / src / bin / lttng-sessiond / sessiond-timer.c
index 1c6bc70baadb052ea552c292ae3255b63e08b7c8..47e50ea675e8d46d1177d5b4b0f16ef0467575aa 100644 (file)
@@ -244,11 +244,24 @@ void relay_rotation_pending_timer(struct timer_thread_parameters *ctx,
        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;
 }
 
 /*
This page took 0.025548 seconds and 5 git commands to generate.