From: Emeric Brun Date: Fri, 10 Jul 2020 13:47:11 +0000 (+0200) Subject: BUG/MEDIUM: log: issue mixing sampled to not sampled log servers. X-Git-Tag: v2.3-dev1~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2f4cc28e0f1c8c3deca8b1b7fa446c6523dcc93c;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: log: issue mixing sampled to not sampled log servers. A boolean was mistakenly declared 'static THREAD_LOCAL' causing the probe of a log to a 'not sampled' log server conditionned by the last evaluated 'sampled log' server test on the same thread. This results to unpredictable drops of logs on 'not sampled' log servers as soon a 'sampled' log server is declared. This patch removes the static THREAD_LOCAL attribute from this boolean, fixing the issue and allowing to mix 'sampled' and 'not sampled' servers. This fix should be backported in any branches which includes the log sampling feature. --- diff --git a/src/log.c b/src/log.c index 937b675a73..9a866f1a2c 100644 --- a/src/log.c +++ b/src/log.c @@ -1832,7 +1832,7 @@ void __send_log(struct list *logsrvs, struct buffer *tag, int level, /* Send log messages to syslog server. */ nblogger = 0; list_for_each_entry(logsrv, logsrvs, list) { - static THREAD_LOCAL int in_range = 1; + int in_range = 1; /* we can filter the level of the messages that are sent to each logger */ if (level > logsrv->level)