mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 12:41:00 +02:00
BUG/MINOR: checks: Rely on next I/O oriented rule when waiting for a connection
In tcpcheck_main(), when we are waiting for a connection, we must rely on the next connect/send/expect rule to subscribe to I/O events, not on the immediate next rule. Because, if it is a set-var or an unset-var rule, we will not subscribe to I/O events while it is in fact mandatory because a send or an expect rule is coming. It is required to wake-up the health check as soon as I/O are possible, instead of hitting a timeout. No backport needed. (cherry picked from commit 758d48f54cc3372c2d8e7c34b926d218089c533a) Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
This commit is contained in:
parent
a2fb0c3b6f
commit
97b2a8b01f
@ -2633,18 +2633,21 @@ static int tcpcheck_main(struct check *check)
|
||||
/* 2- check if we are waiting for the connection establishment. It only
|
||||
* happens during TCPCHK_ACT_CONNECT. */
|
||||
if (check->current_step && check->current_step->action == TCPCHK_ACT_CONNECT) {
|
||||
rule = LIST_NEXT(&check->current_step->list, typeof(rule), list);
|
||||
if (conn && (conn->flags & CO_FL_WAIT_XPRT)) {
|
||||
if (rule->action == TCPCHK_ACT_SEND) {
|
||||
struct tcpcheck_rule *next;
|
||||
|
||||
next = get_next_tcpcheck_rule(check->tcpcheck_rules, check->current_step);
|
||||
if (next && next->action == TCPCHK_ACT_SEND) {
|
||||
if (!(check->wait_list.events & SUB_RETRY_SEND))
|
||||
conn->mux->subscribe(cs, SUB_RETRY_SEND, &check->wait_list);
|
||||
}
|
||||
else if (rule->action == TCPCHK_ACT_EXPECT) {
|
||||
else {
|
||||
if (!(check->wait_list.events & SUB_RETRY_RECV))
|
||||
conn->mux->subscribe(cs, SUB_RETRY_RECV, &check->wait_list);
|
||||
}
|
||||
goto out;
|
||||
}
|
||||
rule = LIST_NEXT(&check->current_step->list, typeof(rule), list);
|
||||
}
|
||||
|
||||
/* 3- check for pending outgoing data. It only happens during
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user