merge syslog-ng 4.9.0 fixes from factory to leap-16.0 #1
133
0001-Merge-pull-request-5437-from-HofiOne-fix-ack-tracker.patch
Normal file
133
0001-Merge-pull-request-5437-from-HofiOne-fix-ack-tracker.patch
Normal file
@@ -0,0 +1,133 @@
|
||||
From 38ac0e645b845d46201944a28829c84539fae983 Mon Sep 17 00:00:00 2001
|
||||
From: Hofi <hofione@gmail.com>
|
||||
Date: Fri, 22 Aug 2025 10:27:38 +0200
|
||||
Subject: [PATCH 1/4] Merge pull request #5437 from
|
||||
HofiOne/fix-ack-tracker-crash
|
||||
|
||||
Fix ack tracker crash
|
||||
|
||||
(cherry picked from commit 5b64de97b4c4bd91956558a175fcfe668a68d6aa)
|
||||
---
|
||||
lib/ack-tracker/consecutive_ack_tracker.c | 16 +++++++---------
|
||||
modules/affile/file-reader.c | 7 ++++++-
|
||||
modules/affile/wildcard-source.c | 4 ++++
|
||||
3 files changed, 17 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/lib/ack-tracker/consecutive_ack_tracker.c b/lib/ack-tracker/consecutive_ack_tracker.c
|
||||
index e99fb1d2c..abc154d4b 100644
|
||||
--- a/lib/ack-tracker/consecutive_ack_tracker.c
|
||||
+++ b/lib/ack-tracker/consecutive_ack_tracker.c
|
||||
@@ -95,12 +95,11 @@ consecutive_ack_tracker_track_msg(AckTracker *s, LogMessage *msg)
|
||||
ConsecutiveAckTracker *self = (ConsecutiveAckTracker *)s;
|
||||
LogSource *source = self->super.source;
|
||||
|
||||
- g_assert(self->pending_ack_record != NULL);
|
||||
-
|
||||
log_pipe_ref((LogPipe *)source);
|
||||
|
||||
consecutive_ack_tracker_lock(s);
|
||||
{
|
||||
+ g_assert(self->pending_ack_record != NULL);
|
||||
_ack_records_track_msg(self, msg);
|
||||
}
|
||||
consecutive_ack_tracker_unlock(s);
|
||||
@@ -178,13 +177,11 @@ static Bookmark *
|
||||
consecutive_ack_tracker_request_bookmark(AckTracker *s)
|
||||
{
|
||||
ConsecutiveAckTracker *self = (ConsecutiveAckTracker *)s;
|
||||
+ Bookmark *bookmark = NULL;
|
||||
|
||||
+ consecutive_ack_tracker_lock(s);
|
||||
if (!self->pending_ack_record)
|
||||
- {
|
||||
- consecutive_ack_tracker_lock(s);
|
||||
- self->pending_ack_record = consecutive_ack_record_container_request_pending(self->ack_records);
|
||||
- consecutive_ack_tracker_unlock(s);
|
||||
- }
|
||||
+ self->pending_ack_record = consecutive_ack_record_container_request_pending(self->ack_records);
|
||||
|
||||
if (self->pending_ack_record)
|
||||
{
|
||||
@@ -192,10 +189,11 @@ consecutive_ack_tracker_request_bookmark(AckTracker *s)
|
||||
|
||||
self->pending_ack_record->super.tracker = (AckTracker *)self;
|
||||
|
||||
- return &(self->pending_ack_record->super.bookmark);
|
||||
+ bookmark = &(self->pending_ack_record->super.bookmark);
|
||||
}
|
||||
+ consecutive_ack_tracker_unlock(s);
|
||||
|
||||
- return NULL;
|
||||
+ return bookmark;
|
||||
}
|
||||
|
||||
static void
|
||||
diff --git a/modules/affile/file-reader.c b/modules/affile/file-reader.c
|
||||
index fd5fd166c..016c0f652 100644
|
||||
--- a/modules/affile/file-reader.c
|
||||
+++ b/modules/affile/file-reader.c
|
||||
@@ -512,11 +512,14 @@ _on_file_deleted(FileReader *self)
|
||||
log_reader_trigger_one_check(self->reader);
|
||||
}
|
||||
|
||||
+#if SYSLOG_NG_HAVE_INOTIFY
|
||||
static inline void
|
||||
_on_file_modified(FileReader *self)
|
||||
{
|
||||
- log_reader_trigger_one_check(self->reader);
|
||||
+ if (self->options->follow_method == FM_INOTIFY)
|
||||
+ log_reader_trigger_one_check(self->reader);
|
||||
}
|
||||
+#endif
|
||||
|
||||
static void
|
||||
_on_read_error(FileReader *self)
|
||||
@@ -549,10 +552,12 @@ file_reader_notify_method(LogPipe *s, gint notify_code, gpointer user_data)
|
||||
_on_file_deleted(self);
|
||||
break;
|
||||
|
||||
+#if SYSLOG_NG_HAVE_INOTIFY
|
||||
case NC_FILE_MODIFIED:
|
||||
/* This is a notification from the directory monitor, we can read the file for changes */
|
||||
_on_file_modified(self);
|
||||
break;
|
||||
+#endif
|
||||
|
||||
default:
|
||||
break;
|
||||
diff --git a/modules/affile/wildcard-source.c b/modules/affile/wildcard-source.c
|
||||
index 3545d4f4a..7cdf2814b 100644
|
||||
--- a/modules/affile/wildcard-source.c
|
||||
+++ b/modules/affile/wildcard-source.c
|
||||
@@ -223,6 +223,7 @@ _handler_directory_deleted(WildcardSourceDriver *self, const DirectoryMonitorEve
|
||||
}
|
||||
}
|
||||
|
||||
+#if SYSLOG_NG_HAVE_INOTIFY
|
||||
static void
|
||||
_handler_file_modified(WildcardSourceDriver *self, const DirectoryMonitorEvent *event)
|
||||
{
|
||||
@@ -231,6 +232,7 @@ _handler_file_modified(WildcardSourceDriver *self, const DirectoryMonitorEvent *
|
||||
if (reader)
|
||||
log_pipe_notify(&reader->super.super, NC_FILE_MODIFIED, NULL);
|
||||
}
|
||||
+#endif
|
||||
|
||||
static void
|
||||
_on_directory_monitor_changed(const DirectoryMonitorEvent *event, gpointer user_data)
|
||||
@@ -255,10 +257,12 @@ _on_directory_monitor_changed(const DirectoryMonitorEvent *event, gpointer user_
|
||||
{
|
||||
_handler_directory_deleted(self, event);
|
||||
}
|
||||
+#if SYSLOG_NG_HAVE_INOTIFY
|
||||
else if (event->event_type == FILE_MODIFIED)
|
||||
{
|
||||
_handler_file_modified(self, event);
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
2.51.0
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
From 44b26512a7bf9c78f07ea5db4b0dcf10f2475052 Mon Sep 17 00:00:00 2001
|
||||
From: Hofi <hofione@gmail.com>
|
||||
Date: Tue, 26 Aug 2025 15:34:52 +0200
|
||||
Subject: [PATCH 2/4] Merge pull request #5441 from HofiOne/fix-mem-leaks
|
||||
|
||||
stats-exporter: fixed various leaks
|
||||
(cherry picked from commit 4a1c3f00cdd93f7c82c3ce45b30fcbc7d705c056)
|
||||
---
|
||||
lib/logproto/logproto-buffered-server.c | 2 ++
|
||||
lib/logproto/logproto-http-scraper-responder-server.c | 5 +++++
|
||||
2 files changed, 7 insertions(+)
|
||||
|
||||
diff --git a/lib/logproto/logproto-buffered-server.c b/lib/logproto/logproto-buffered-server.c
|
||||
index eab78afe4..35c3555d0 100644
|
||||
--- a/lib/logproto/logproto-buffered-server.c
|
||||
+++ b/lib/logproto/logproto-buffered-server.c
|
||||
@@ -572,6 +572,8 @@ error:
|
||||
else
|
||||
{
|
||||
self->persist_state = NULL;
|
||||
+ if (self->state1)
|
||||
+ g_free(self->state1);
|
||||
self->state1 = new_state;
|
||||
}
|
||||
}
|
||||
diff --git a/lib/logproto/logproto-http-scraper-responder-server.c b/lib/logproto/logproto-http-scraper-responder-server.c
|
||||
index 7f3f13cd2..ee8e6ecf9 100644
|
||||
--- a/lib/logproto/logproto-http-scraper-responder-server.c
|
||||
+++ b/lib/logproto/logproto-http-scraper-responder-server.c
|
||||
@@ -34,6 +34,7 @@
|
||||
static LogProtoHTTPScraperResponder *single_instance;
|
||||
static time_t last_scrape_request_time;
|
||||
|
||||
+// FIXME: cleanup mutex on program exit
|
||||
static inline GMutex *
|
||||
_mutex(void)
|
||||
{
|
||||
@@ -141,6 +142,8 @@ _log_proto_http_scraper_responder_server_free(LogProtoServer *s)
|
||||
LogProtoHTTPScraperResponder *self = (LogProtoHTTPScraperResponder *)s;
|
||||
if (self->options->single_instance)
|
||||
single_instance = NULL;
|
||||
+ // The base LogProtoHTTPServer has no overridden free_fn, so we call its base LogProtoTextServer free directly
|
||||
+ log_proto_text_server_free(s);
|
||||
g_mutex_unlock(_mutex());
|
||||
}
|
||||
|
||||
@@ -227,6 +230,8 @@ log_proto_http_scraper_responder_options_destroy(LogProtoServerOptionsStorage *o
|
||||
LogProtoHTTPScraperResponderOptions *options = &((LogProtoHTTPScraperResponderOptionsStorage *)options_storage)->super;
|
||||
|
||||
log_proto_http_server_options_destroy(options_storage);
|
||||
+ g_free(options->scraper_request_hdr_pattern);
|
||||
+ options->scraper_request_hdr_pattern = NULL;
|
||||
g_free(options->stat_query);
|
||||
options->stat_query = NULL;
|
||||
g_free(options->stat_format);
|
||||
--
|
||||
2.51.0
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
From 9e551271cc29aaf135eb2226c0048546c2bf5fe4 Mon Sep 17 00:00:00 2001
|
||||
From: Hofi <hofione@gmail.com>
|
||||
Date: Mon, 1 Sep 2025 09:31:22 +0200
|
||||
Subject: [PATCH 3/4] Merge pull request #5445 from
|
||||
beni-atlnz/log-writer-cfg-bug
|
||||
|
||||
Fix invalid access of freed log-writer cfg
|
||||
|
||||
(cherry picked from commit 304069cb4ea068c7c982a8052b47cff75fd172e8)
|
||||
---
|
||||
modules/afprog/afprog.c | 15 +++++++++++----
|
||||
news/bugfix-5444.md | 1 +
|
||||
2 files changed, 12 insertions(+), 4 deletions(-)
|
||||
create mode 100644 news/bugfix-5444.md
|
||||
|
||||
diff --git a/modules/afprog/afprog.c b/modules/afprog/afprog.c
|
||||
index 4b6d51135..75b32f7a8 100644
|
||||
--- a/modules/afprog/afprog.c
|
||||
+++ b/modules/afprog/afprog.c
|
||||
@@ -519,7 +519,7 @@ afprogram_dd_exit(pid_t pid, int status, gpointer s)
|
||||
static gboolean
|
||||
afprogram_dd_restore_reload_store_item(AFProgramDestDriver *self, GlobalConfig *cfg)
|
||||
{
|
||||
- const gchar *persist_name = afprogram_dd_format_persist_name((const LogPipe *)self);
|
||||
+ const gchar *persist_name = afprogram_dd_format_persist_name((const LogPipe *) self);
|
||||
AFProgramReloadStoreItem *restored_info =
|
||||
(AFProgramReloadStoreItem *)cfg_persist_config_fetch(cfg, persist_name);
|
||||
|
||||
@@ -573,9 +573,13 @@ afprogram_dd_init(LogPipe *s)
|
||||
log_writer_options_init(&self->writer_options, cfg, 0);
|
||||
|
||||
const gboolean restore_successful = afprogram_dd_restore_reload_store_item(self, cfg);
|
||||
-
|
||||
- if (!self->writer)
|
||||
- self->writer = log_writer_new(LW_FORMAT_FILE, s->cfg);
|
||||
+ if (restore_successful)
|
||||
+ log_pipe_set_config((LogPipe *) self->writer, cfg);
|
||||
+ else
|
||||
+ {
|
||||
+ g_assert(self->writer == NULL);
|
||||
+ self->writer = log_writer_new(LW_FORMAT_FILE, cfg);
|
||||
+ }
|
||||
|
||||
StatsClusterKeyBuilder *writer_sck_builder;
|
||||
StatsClusterKeyBuilder *driver_sck_builder;
|
||||
@@ -640,6 +644,9 @@ afprogram_dd_deinit(LogPipe *s)
|
||||
|
||||
if (self->keep_alive)
|
||||
{
|
||||
+ // Do not store the writer's config, as it will be freshly initialized during reload
|
||||
+ // TODO: by a good chance this should go to log_pipe_deinit, investigate it
|
||||
+ log_pipe_reset_config((LogPipe *) self->writer);
|
||||
afprogram_dd_store_reload_store_item(self, cfg);
|
||||
}
|
||||
else
|
||||
diff --git a/news/bugfix-5444.md b/news/bugfix-5444.md
|
||||
new file mode 100644
|
||||
index 000000000..fb8fdc9d8
|
||||
--- /dev/null
|
||||
+++ b/news/bugfix-5444.md
|
||||
@@ -0,0 +1 @@
|
||||
+afprog: Fix invalid access of freed log-writer cfg.
|
||||
--
|
||||
2.51.0
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From 8f22f67ecdce4991ce8b5a8f271e6db3e0e5dc35 Mon Sep 17 00:00:00 2001
|
||||
From: therandomstring <bal.horv.98@gmail.com>
|
||||
Date: Thu, 28 Aug 2025 14:14:59 +0200
|
||||
Subject: [PATCH 4/4] Merge pull request #5447 from
|
||||
therandomstring/s3-fix-missing-upload-trigger
|
||||
|
||||
S3: Fix missing upload trigger
|
||||
(cherry picked from commit e0b765ef9b82abc9127c3e71c3971279450b614e)
|
||||
---
|
||||
modules/python-modules/syslogng/modules/s3/s3_destination.py | 2 ++
|
||||
news/bugfix-5447.md | 1 +
|
||||
2 files changed, 3 insertions(+)
|
||||
create mode 100644 news/bugfix-5447.md
|
||||
|
||||
diff --git a/modules/python-modules/syslogng/modules/s3/s3_destination.py b/modules/python-modules/syslogng/modules/s3/s3_destination.py
|
||||
index cd78b6db2..26b39c779 100644
|
||||
--- a/modules/python-modules/syslogng/modules/s3/s3_destination.py
|
||||
+++ b/modules/python-modules/syslogng/modules/s3/s3_destination.py
|
||||
@@ -371,6 +371,8 @@ class S3Destination(LogDestination):
|
||||
with self.__indices_lock:
|
||||
last_index = self.__indices.pop(s3_object.object_key)
|
||||
self.__indices[s3_object.object_key] = last_index
|
||||
+ if not self.s3_object_ready_queue.queue.empty():
|
||||
+ self.__session_handler.trigger_upload()
|
||||
|
||||
self.__start_flush_poll_timer()
|
||||
|
||||
diff --git a/news/bugfix-5447.md b/news/bugfix-5447.md
|
||||
new file mode 100644
|
||||
index 000000000..7bb8cdde7
|
||||
--- /dev/null
|
||||
+++ b/news/bugfix-5447.md
|
||||
@@ -0,0 +1 @@
|
||||
+s3: Fixed bug where in certain conditions finished object buffers would fail to upload.
|
||||
--
|
||||
2.51.0
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 11 08:23:19 UTC 2025 - peter czanik <peter@czanik.hu>
|
||||
|
||||
- backport major bug fixes from development branch fixing various
|
||||
crashes and message loss
|
||||
* 0001-Merge-pull-request-5437-from-HofiOne-fix-ack-tracker.patch
|
||||
* 0002-Merge-pull-request-5441-from-HofiOne-fix-mem-leaks.patch
|
||||
* 0003-Merge-pull-request-5445-from-beni-atlnz-log-writer-c.patch
|
||||
* 0004-Merge-pull-request-5447-from-therandomstring-s3-fix-.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 16 13:00:05 UTC 2025 - peter czanik <peter@czanik.hu>
|
||||
|
||||
|
||||
@@ -108,6 +108,10 @@ Source2: syslog-ng.conf.default
|
||||
Source3: syslog-ng.service
|
||||
Source4: syslog-ng-service-prepare
|
||||
Patch0: syslog-ng-reproducible-jar-mtime.patch
|
||||
Patch1: 0001-Merge-pull-request-5437-from-HofiOne-fix-ack-tracker.patch
|
||||
Patch2: 0002-Merge-pull-request-5441-from-HofiOne-fix-mem-leaks.patch
|
||||
Patch3: 0003-Merge-pull-request-5445-from-beni-atlnz-log-writer-c.patch
|
||||
Patch4: 0004-Merge-pull-request-5447-from-therandomstring-s3-fix-.patch
|
||||
BuildRequires: bison
|
||||
BuildRequires: flex
|
||||
BuildRequires: gcc-c++
|
||||
@@ -409,6 +413,10 @@ This package provides MQTT support for syslog-ng
|
||||
%patch -P 0 -p1
|
||||
%endif
|
||||
%endif
|
||||
%patch -P 1 -p1
|
||||
%patch -P 2 -p1
|
||||
%patch -P 3 -p1
|
||||
%patch -P 4 -p1
|
||||
# fill out placeholders in the config,
|
||||
# systemd service and prepare script.
|
||||
for file in \
|
||||
|
||||
Reference in New Issue
Block a user