From: PiBa-NL Date: Wed, 2 May 2018 20:27:14 +0000 (+0200) Subject: BUG/MINOR, BUG/MINOR: lua: Put tasks to sleep when waiting for data X-Git-Tag: v1.9-dev1~276 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe971b35aeca9994f3823112c783aa796e74075a;p=thirdparty%2Fhaproxy.git BUG/MINOR, BUG/MINOR: lua: Put tasks to sleep when waiting for data If a lua socket is waiting for data it currently spins at 100% cpu usage. This because the TICK_ETERNITY returned by the socket is ignored when setting the 'expire' time of the task. Fixed by removing the check for yields that return TICK_ETERNITY. This should be backported to at least 1.8. --- diff --git a/src/hlua.c b/src/hlua.c index 32199c9640..4c56409cb4 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -5552,8 +5552,7 @@ static struct task *hlua_process_task(struct task *task) case HLUA_E_AGAIN: /* co process or timeout wake me later. */ notification_gc(&hlua->com); - if (hlua->wake_time != TICK_ETERNITY) - task->expire = hlua->wake_time; + task->expire = hlua->wake_time; break; /* finished with error. */