]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: ssl: properly remove the TASK_HEAVY flag at end of handshake
authorWilly Tarreau <w@1wt.eu>
Tue, 9 Mar 2021 16:58:02 +0000 (17:58 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 9 Mar 2021 16:58:02 +0000 (17:58 +0100)
Emeric found that SSL+keepalive traffic had dropped quite a bit in the
recent changes, which could be bisected to recent commit 9205ab31d
("MINOR: ssl: mark the SSL handshake tasklet as heavy"). Indeed, a
first incarnation of this commit made use of the TASK_SELF_WAKING
flag but the last version directly used TASK_HEAVY, but it would still
continue to remove the already absent TASK_SELF_WAKING one instead of
TASK_HEAVY. As such, the SSL traffic remained processed with low
granularity.

No backport is needed as this is only 2.4.

src/ssl_sock.c

index 4ff1d33360b9426a5d8fd16c17f3c83c81a07bbc..1638996e41c7f2e7810f615dbcea3375d3d92470 100644 (file)
@@ -5861,7 +5861,7 @@ struct task *ssl_sock_io_cb(struct task *t, void *context, unsigned int state)
                ssl_sock_handshake(ctx->conn, CO_FL_SSL_WAIT_HS);
                if (!(ctx->conn->flags & CO_FL_SSL_WAIT_HS)) {
                        /* handshake completed, leave the bulk queue */
-                       _HA_ATOMIC_AND(&tl->state, ~TASK_SELF_WAKING);
+                       _HA_ATOMIC_AND(&tl->state, ~TASK_HEAVY);
                }
        }
        /* If we had an error, or the handshake is done and I/O is available,