mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
BUG/MINOR: stconn: don't wake up an applet waiting on buffer allocation
Since the extension of the buffers API to applets in 3.0-dev, an applet may find itself unable to allocate a buffer, and will block respectively on APPCTX_FL_OUTBLK_ALLOC or APPCTX_FL_INBLK_ALLOC depending on the direction. However the code in sc_applet_process() doesn't consider this situation when deciding to wake up an applet, so when the condition arises, the applet keeps ringing and is killed by the loop detector. The fix is trivial and simply consists in checking for the flags above. No backport is needed since this is new in 3.0.
This commit is contained in:
parent
12d08cf912
commit
072686dafd
@ -2309,7 +2309,8 @@ int sc_applet_process(struct stconn *sc)
|
|||||||
* appctx but in the case the task is not in runqueue we may have to
|
* appctx but in the case the task is not in runqueue we may have to
|
||||||
* wakeup the appctx immediately.
|
* wakeup the appctx immediately.
|
||||||
*/
|
*/
|
||||||
if (sc_is_recv_allowed(sc) || sc_is_send_allowed(sc))
|
if ((sc_is_recv_allowed(sc) && !applet_fl_test(__sc_appctx(sc), APPCTX_FL_OUTBLK_ALLOC)) ||
|
||||||
|
(sc_is_send_allowed(sc) && !applet_fl_test(__sc_appctx(sc), APPCTX_FL_INBLK_ALLOC)))
|
||||||
appctx_wakeup(__sc_appctx(sc));
|
appctx_wakeup(__sc_appctx(sc));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user