]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Useless I/O handler task wakeups (draining, killing state)
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 24 Apr 2023 09:32:22 +0000 (11:32 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Mon, 24 Apr 2023 09:47:11 +0000 (11:47 +0200)
From the idle_timer_task(), the I/O handler must be woken up to send ack. But
there is no reason to do that in draining state or killing state. In draining
state this is even forbidden.

Must be backported to 2.7.

src/quic_conn.c

index 43737ec0a480d27a50654935b6be0c9d60c2fa4f..ee1196308935c100c14c8e53588a1b3d4a3e7011 100644 (file)
@@ -5882,8 +5882,14 @@ struct task *qc_idle_timer_task(struct task *t, void *ctx, unsigned int state)
                qc->ack_expire = TICK_ETERNITY;
                /* Note that ->idle_expire is always set. */
                t->expire = qc->idle_expire;
-               qc->flags |= QUIC_FL_CONN_ACK_TIMER_FIRED;
-               tasklet_wakeup(qc->wait_event.tasklet);
+               /* Do not wakeup the I/O handler in DRAINING state or if the
+                * connection must be killed as soon as possible.
+                */
+               if (!(qc->flags & (QUIC_FL_CONN_DRAINING|QUIC_FL_CONN_TO_KILL))) {
+                       qc->flags |= QUIC_FL_CONN_ACK_TIMER_FIRED;
+                       tasklet_wakeup(qc->wait_event.tasklet);
+               }
+
                goto requeue;
        }