]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MAJOR: lua: fix the impact of the scheduler changes again
authorWilly Tarreau <w@1wt.eu>
Wed, 23 Aug 2017 14:07:33 +0000 (16:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Aug 2017 14:07:33 +0000 (16:07 +0200)
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

index 0045a1c5d9456e0c0c8d94ddb76c76bb0f9de4ca..bd3674a5515a8ca7a2cfade1aa7fda4c4fa7ae5d 100644 (file)
@@ -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;
 }