Thank you Camilo for the bug repport. Willy, you can take in addition the attached patch. It is the same fix for the same behavior for other lua functions (actions, converters and fetches).
Theses are less visible because the default timeout is not set to TICK_ETERNITY. Thierry On Sun, 9 Aug 2015 10:24:12 +0200 Willy Tarreau <[email protected]> wrote: > Hi Camilo, > > On Mon, Aug 03, 2015 at 12:09:38PM -0400, Camilo Lopez wrote: > > Willy, > > > > Here is the single line patch (sans comment). > > It was mangled (spaces vs tabs, probably due to the mail agent), > but since it was trivial, this time I've applied it by hand. > > Thanks! > Willy > >
>From a0111318a954f971c8d3c9f70454e3a6fde2daa7 Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER <[email protected]> Date: Sun, 9 Aug 2015 13:10:24 +0200 Subject: [PATCH] BUG/MEDIUM: lua: timeout error with converters, wrapper and actions. test conf: global tune.lua.session-timeout 0 lua-load lol.lua debug maxconn 4096 listen test bind 0.0.0.0:10010 mode tcp tcp-request content lua act_test balance roundrobin server test 127.0.0.1:3304 lua test: function act_test(txn) while true do core.Alert("TEST") end end The function "act_test()" is not executed because a zero timeout is not considered as TICK_ETERNITY, but is considered as 0. This path fix this behavior. This is the same problem than the bugfix 685c014e99195d60db0a9cdbc6483f9c44fd0a67. --- src/hlua.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hlua.c b/src/hlua.c index 8e92134..f2e58a9 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -3944,7 +3944,7 @@ static int hlua_sample_conv_wrapper(const struct arg *arg_p, struct sample *smp, } /* We must initialize the execution timeouts. */ - stream->hlua.expire = tick_add(now_ms, hlua_timeout_session); + stream->hlua.expire = tick_add_ifset(now_ms, hlua_timeout_session); /* Set the currently running flag. */ HLUA_SET_RUN(&stream->hlua); @@ -4050,7 +4050,7 @@ static int hlua_sample_fetch_wrapper(const struct arg *arg_p, struct sample *smp } /* We must initialize the execution timeouts. */ - stream->hlua.expire = tick_add(now_ms, hlua_timeout_session); + stream->hlua.expire = tick_add_ifset(now_ms, hlua_timeout_session); /* Set the currently running flag. */ HLUA_SET_RUN(&stream->hlua); @@ -4322,7 +4322,7 @@ static int hlua_request_act_wrapper(struct hlua_rule *rule, struct proxy *px, } /* We must initialize the execution timeouts. */ - s->hlua.expire = tick_add(now_ms, hlua_timeout_session); + s->hlua.expire = tick_add_ifset(now_ms, hlua_timeout_session); /* Set the currently running flag. */ HLUA_SET_RUN(&s->hlua); -- 1.7.10.4

