From: Christopher Faulet Date: Fri, 18 Jul 2025 14:09:20 +0000 (+0200) Subject: BUG/MEDIUM: hlua: Report to SC when output data are blocked on a lua socket X-Git-Tag: v3.0.12~94 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=3597a6f396dcdd5fb011cf7aba5c03d156c12d86;p=haproxy-3.0.git BUG/MEDIUM: hlua: Report to SC when output data are blocked on a lua socket It is a fix similar to the previous one ("BUG/MEDIUM: hlua: Report to SC when data were consumed on a lua socket"), but for the write side. The writer must notify the cosocket it needs more space in the request buffer to produce more data by calling sc_need_room(). Otherwise, there is nothing to prevent to wake the cosocket applet up again and again. This patch must be backported as far as 2.8, and maybe to 2.6 too. (cherry picked from commit 7e96ff6b84b7d7e0805a9a4e87a0a85b6b976df8) Signed-off-by: Willy Tarreau (cherry picked from commit 839755b1d401928df89b4fd8b146a20a17e28a3d) Signed-off-by: Christopher Faulet (cherry picked from commit 503d60bac653237d618ecb21c468d65855473484) Signed-off-by: Christopher Faulet --- diff --git a/src/hlua.c b/src/hlua.c index 0b1a7f4..e0b647b 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -3172,6 +3172,7 @@ hlua_socket_write_yield_return: WILL_LJMP(luaL_error(L, "out of memory")); } xref_unlock(&socket->xref, peer); + sc_need_room(sc, channel_recv_max(&s->req) + 1); MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_socket_write_yield, TICK_ETERNITY, 0)); return 0; }