]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: lua: some function are not yieldable, the forced yield causes errors
authorThierry FOURNIER <tfournier@exceliance.fr>
Fri, 6 Mar 2015 13:05:24 +0000 (14:05 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Mar 2015 16:47:52 +0000 (17:47 +0100)
commitcae49c9ee8756da423c1f8cab74ed4a850988be1
tree90bac6477beced3cf7aa7aac5532e7231446f9a4
parentf90838b71a3c7f84e1d8b4ff85760a35d60c6910
BUG/MAJOR: lua: some function are not yieldable, the forced yield causes errors

The hook function called each nth Lua instructions just
do a yield. Sometimes this yield is not allowed, because
some functions are not compatible.

The Lua-5.3 permits to known if the yield is avalaible with
the function lua_isyieldable().

If the processing is interrupted in non yieldable state,
we try to execute a yield asap. The yield will be may
available at the end of the non-yieldable currently
executed function. So, we require interrupt at the end
of the current function.

But, Lua cannot yield when its returning from a function,
so, we can fix the interrupt hook to 1 instruction,
expecting that the function is finnished.

During this time, the execution timeout is always checked.
src/hlua.c