BUG/MINOR: lua: Don't yield in channel.append() and channel.set()
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 6 Aug 2021 07:59:49 +0000 (09:59 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 20 Sep 2021 14:39:06 +0000 (16:39 +0200)
commitad444ff97125994bb088ca945f858bca5367ba50
treede341f18c33b62325738ce84c77e44aac89c40a4
parentd33a546594399bbacc8ae9db3e1adc5776c55a17
BUG/MINOR: lua: Don't yield in channel.append() and channel.set()

Lua functions to set or append data to the input part of a channel must not
yield because new data may be received while the lua script is suspended. So
adding data to the input part in several passes is highly unpredicatble and
may be interleaved with received data.

Note that if necessary, it is still possible to suspend a lua action by
returning act.YIELD. This way the whole action will be reexecuted later
because of I/O events or a timer. Another solution is to call core.yield().

This bug affects all stable versions. So, it may be backported. But it is
probably not necessary because nobody notice it till now.

(cherry picked from commit 3b7bc3e38b7c3e889ca77415cb6b5d91e92cc0c4)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/hlua.c