From 39cfadd028360aeaaca99b8f26bdd5f82cfc4707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?= Date: Thu, 19 Sep 2024 12:49:46 +0200 Subject: [PATCH] logsource: fix free_window counters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The value of free_window was not updated properly as the counter was deregistered in deinit(), but AckTrackers propagate acknowledgments even after the source is deinitialized. Signed-off-by: László Várady --- lib/logsource.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/logsource.c b/lib/logsource.c index 1366f647e5..06586d5fbd 100644 --- a/lib/logsource.c +++ b/lib/logsource.c @@ -538,8 +538,6 @@ _unregister_counters(LogSource *self) instance_name); stats_unregister_counter(&sc_key, SC_TYPE_STAMP, &self->metrics.last_message_seen); - _unregister_window_stats(self); - stats_unlock(); } @@ -800,6 +798,10 @@ log_source_free(LogPipe *s) g_free(self->name); g_free(self->stats_id); + stats_lock(); + _unregister_window_stats(self); + stats_unlock(); + if (self->metrics.stats_kb) stats_cluster_key_builder_free(self->metrics.stats_kb);