]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: Remove sync sends from streams to applets
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 22 Jul 2025 13:15:34 +0000 (15:15 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 24 Jul 2025 07:16:56 +0000 (09:16 +0200)
When the applet API was reviewed to use dedicated buffers, the support for
sends from the streams to applets was added. Unfortunately, it was not a
good idea because this way it is possible to deliver data to an applet and
release it just after, truncated data. Indeed, the release stage for applets
is related to the stream release itself. However, unlike the multiplexers,
the applets cannot survive to a stream for now.

So, for now, the sync sends from the streams is removed for applets, waiting
for a better way to handle the applets release stage.

Note that this only concerns applets using their own buffers. And of now,
the bug is harmless because all refactored applets are on server side and
consume data first. But this will be an issue with the HTTP client.

This patch should be backported as far as 3.0 after a period of observation.

include/haproxy/sc_strm.h

index 3e2bea0bdac266ae9a9ce933adff7b16479f3f7b..996b7ea88b5d49bfa3abfe5e158f72097b3d45ac 100644 (file)
@@ -348,15 +348,6 @@ static inline void sc_sync_send(struct stconn *sc)
 {
        if (sc_ep_test(sc, SE_FL_T_MUX))
                sc_conn_sync_send(sc);
-       else if (sc_ep_test(sc, SE_FL_T_APPLET)) {
-               sc_applet_sync_send(sc);
-               if (sc_oc(sc)->flags & CF_WRITE_EVENT) {
-                       /* Data was send, wake the applet up. It is safe to do so because sc_applet_sync_send()
-                        * removes CF_WRITE_EVENT flag from the channel before trying to send data to the applet.
-                        */
-                       task_wakeup(__sc_appctx(sc)->t, TASK_WOKEN_OTHER);
-               }
-       }
 }
 
 /* Combines both sc_update_rx() and sc_update_tx() at once */