]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: lua/threads: Make lua's tasks sticky to the current thread
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 25 Apr 2018 08:34:45 +0000 (10:34 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 26 Apr 2018 20:58:16 +0000 (22:58 +0200)
commit5bc9972ed836517924eea91954d255d317a53418
tree57a3fe85238eade1c0bdaa777b612484dad6e1f7
parent1e0867cfbc5bd6ec028a5c8eaa4386b2a402eb37
BUG/MINOR: lua/threads: Make lua's tasks sticky to the current thread

PiBa-NL reported a bug with tasks registered in lua when HAProxy is started with
serveral threads. These tasks have not specific affinity with threads so they
can be woken up on any threads. So, it is impossbile for these tasks to handled
cosockets or applets, because cosockets and applets are sticky on the thread
which created them. It is forbbiden to manipulate a cosocket from another
thread.

So to fix the bug, tasks registered in lua are now sticky to the current
thread. Because these tasks can be registered before threads creation, the
affinity is set the first time a lua's task is processed.

This patch must be backported in HAProxy 1.8.
src/hlua.c