]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stconn: Set fsb date if zero-copy forwarding is blocked during nego
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 5 Jan 2024 15:59:06 +0000 (16:59 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 5 Jan 2024 16:28:06 +0000 (17:28 +0100)
During the zero-copy forwarding, if the consumer side reports it is blocked,
it means it is blocked on send. At the stream-connector level, the event
must be reported to be sure to set/update the fsb date. Otherwise, write
timeouts cannot be properly reported. If this happens when no other timeout
is armed, this freezes the stream.

This patch must be backported to 2.9.

include/haproxy/stconn.h

index afab784cae0dddbfd223b87d1f4f80056032a54b..7869fa340625ac04c355650d479e83b85868e888 100644 (file)
@@ -518,11 +518,15 @@ static inline size_t se_nego_ff(struct sedesc *se, struct buffer *input, size_t
                        }
 
                        ret = mux->nego_fastfwd(se->sc, input, count, may_splice);
-                       if ((se->iobuf.flags & IOBUF_FL_FF_BLOCKED) && !(se->sc->wait_event.events & SUB_RETRY_SEND)) {
-                               /* The SC must be subs for send to be notify when some
-                                * space is made
-                                */
-                               mux->subscribe(se->sc, SUB_RETRY_SEND, &se->sc->wait_event);
+                       if (se->iobuf.flags & IOBUF_FL_FF_BLOCKED) {
+                               sc_ep_report_blocked_send(se->sc, 0);
+
+                               if (!(se->sc->wait_event.events & SUB_RETRY_SEND)) {
+                                       /* The SC must be subs for send to be notify when some
+                                        * space is made
+                                        */
+                                       mux->subscribe(se->sc, SUB_RETRY_SEND, &se->sc->wait_event);
+                               }
                        }
                        goto end;
                }