]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: lua: dead lock when Lua tasks are trigerred
authorThierry FOURNIER <thierry.fournier@ozon.io>
Sun, 6 Jan 2019 18:04:24 +0000 (19:04 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 7 Jan 2019 09:54:19 +0000 (10:54 +0100)
commitbf90ce12aaf71f7a18a1ad63d3a0b6909be97512
tree339b2dba90b508ac6a571f055d412556fd3c90a8
parent1725c2e3951d4eeae136125f417c620fa0ed3847
BUG/MEDIUM: lua: dead lock when Lua tasks are trigerred

When a task is created from Lua context out of initialisation,
the hlua_ctx_init() function can be called from safe environement,
so we must not initialise it. While the support of threads appear,
the safe environment set a lock to ensure only one Lua execution
at a time. If we initialize safe environment in another safe
environmenet, we have a dead lock.

this patch adds the support of the idicator "already_safe" whoch
indicates if the context is initialized form safe Lua fonction.

thank to Flakebi for the report

This patch must be backported to haproxy-1.9 and haproxy-1.8
src/hlua.c