From: Willy Tarreau Date: Wed, 23 Aug 2017 14:07:33 +0000 (+0200) Subject: BUG/MAJOR: lua: fix the impact of the scheduler changes again X-Git-Tag: v1.8-dev3~157 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d9587418867d86aa503c249272634139fe909cbf;p=thirdparty%2Fhaproxy.git BUG/MAJOR: lua: fix the impact of the scheduler changes again Commit d1aa41f ("BUG/MAJOR: lua: properly dequeue hlua_applet_wakeup() for new scheduler") tried to address the side effects of the scheduler changes on Lua, but it was not enough. Having some Lua code send data in chunks separated by one second each clearly shows busy polling being done. The issue was tracked down to hlua_applet_wakeup() being woken up on timer expiration, and returning itself without clearing the timeout, causing the task to be re-inserted with an expiration date in the past, thus firing again. In the past it was not a problem, as returning NULL was enough to clear the timer. Now we can't rely on this anymore so it's important to clear this timeout. No backport is needed, this issue is specific to 1.8-dev and results from an incomplete fix in the commit above. --- diff --git a/src/hlua.c b/src/hlua.c index 0045a1c5d9..bd3674a551 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -5971,6 +5971,7 @@ struct task *hlua_applet_wakeup(struct task *t) */ si_applet_cant_put(si); appctx_wakeup(ctx); + t->expire = TICK_ETERNITY; return t; }