BUG/MEDIUM: log: issue mixing sampled to not sampled log servers.
authorEmeric Brun <ebrun@haproxy.com>
Fri, 10 Jul 2020 13:47:11 +0000 (15:47 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 17 Jul 2020 08:28:58 +0000 (10:28 +0200)
commitb2bb526fa46b5e2119683d60e9a7ddefad801965
tree3d8ea157dd5af5f06900a30a0ce31dd586aec7a5
parent37daeffac123f8a0f33d929060f07a75add91b30
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.

(cherry picked from commit 2f4cc28e0f1c8c3deca8b1b7fa446c6523dcc93c)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 9ce61f6d578876f1eda258d4cfad997e09c140a4)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/log.c