From: Olivier Houchard Date: Wed, 17 Apr 2019 17:29:35 +0000 (+0200) Subject: BUG/MEDIUM: applets: Don't use task_in_rq(). X-Git-Tag: v2.0-dev3~237 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=51205a1958f5e83121deac1d4e818bd5712fe12d;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: applets: Don't use task_in_rq(). When deciding if we want to wake the task of an applet up, don't give up if task_in_rq returns 1, as there's a race condition and another thread may run it. Instead, always attempt to task_wakeup(), at worst the task is already in the run queue, and nothing will happen. --- diff --git a/src/stream_interface.c b/src/stream_interface.c index 501897a840..1e50c1fc91 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -1468,9 +1468,8 @@ void si_applet_wake_cb(struct stream_interface *si) * appctx but in the case the task is not in runqueue we may have to * wakeup the appctx immediately. */ - if (!task_in_rq(si_task(si)) && - ((si_rx_endp_ready(si) && !si_rx_blocked(si)) || - (si_tx_endp_ready(si) && !si_tx_blocked(si)))) + if ((si_rx_endp_ready(si) && !si_rx_blocked(si)) || + (si_tx_endp_ready(si) && !si_tx_blocked(si))) appctx_wakeup(si_appctx(si)); }