From d9587418867d86aa503c249272634139fe909cbf Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 23 Aug 2017 16:07:33 +0200 Subject: [PATCH] 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. --- src/hlua.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hlua.c b/src/hlua.c index 0045a1c5d..bd3674a55 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; }