rsyslog/backport-Terminate-all-tcpsrv-threads-properly.patch

31 lines
1.0 KiB
Diff
Raw Normal View History

2022-12-30 16:53:23 +08:00
From 178a36c9b497a78855e1eda03550c3089473ace7 Mon Sep 17 00:00:00 2001
From: Gabor Orosz <goro@goro.io>
Date: Fri, 14 Jan 2022 19:58:17 +0000
Subject: [PATCH] Terminate all tcpsrv threads properly
Graceful shutdown of Rsyslog could lead to segmentation faults when
multiple imtcp inputs are being used. That is because the rest of the
tcpsrv threads are left behind running, while their underlying objects
are being disposed by the main thread as part of the module
de-initialization.
Signed-off-by: Gabor Orosz <goro@goro.io>
Conflict:NA
Reference:https://github.com/rsyslog/rsyslog/commit/178a36c9b497a78855e1eda03550c3089473ace7
---
plugins/imtcp/imtcp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/imtcp/imtcp.c b/plugins/imtcp/imtcp.c
index 0e689a28d8..a6256acad8 100644
--- a/plugins/imtcp/imtcp.c
+++ b/plugins/imtcp/imtcp.c
@@ -1007,6 +1007,7 @@ CODESTARTrunInput
iRet = tcpsrv.Run(tcpsrv_root->tcpsrv);
/* de-init remaining servers */
+ etry = tcpsrv_root->next;
while(etry != NULL) {
stopSrvWrkr(etry);
etry = etry->next;