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.
This commit is contained in:
Olivier Houchard 2019-04-17 19:29:35 +02:00 committed by Olivier Houchard
parent 0c7a4b6371
commit 51205a1958

View File

@ -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));
}