mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-08 16:23:24 -04:00
BUG/MINOR: tcpcheck: Override external check if healthcheck section is set
When an external check was configured at the proxy level, the healthcheck section set on a server was not considered. The main reason was that the check type of the server was always inherited for the proxy one. To fix the issue, when a healthcheck section is set on a server line, the check type for the server is forced to TCPCHK. This patch must be backported to 3.4.
This commit is contained in:
parent
07deafa104
commit
b227ad2dc7
2 changed files with 3 additions and 3 deletions
|
|
@ -1802,7 +1802,7 @@ int init_srv_check(struct server *srv)
|
|||
if (!srv->do_check || !(srv->proxy->cap & PR_CAP_BE))
|
||||
goto out;
|
||||
|
||||
if ((srv->proxy->options2 & PR_O2_CHK_ANY) != PR_O2_TCPCHK_CHK)
|
||||
if (!srv->check.type && (srv->proxy->options2 & PR_O2_CHK_ANY) != PR_O2_TCPCHK_CHK)
|
||||
goto init;
|
||||
|
||||
check_type = srv->check.tcpcheck->rs->flags & TCPCHK_RULES_PROTO_CHK;
|
||||
|
|
@ -1945,7 +1945,7 @@ int init_srv_check(struct server *srv)
|
|||
}
|
||||
|
||||
init:
|
||||
err = init_check(&srv->check, srv->proxy->options2 & PR_O2_CHK_ANY);
|
||||
err = init_check(&srv->check, srv->check.type ? srv->check.type : (srv->proxy->options2 & PR_O2_CHK_ANY));
|
||||
if (err) {
|
||||
ha_alert("config: %s '%s': unable to init check for server '%s' (%s).\n",
|
||||
proxy_type_str(srv->proxy), srv->proxy->id, srv->id, err);
|
||||
|
|
|
|||
|
|
@ -4198,7 +4198,7 @@ int check_server_tcpcheck(struct server *srv)
|
|||
}
|
||||
srv->check.tcpcheck->rs = rs;
|
||||
srv->check.tcpcheck->flags = rs->conf.flags;
|
||||
|
||||
srv->check.type = PR_O2_TCPCHK_CHK;
|
||||
err_code = check_tcpcheck_ruleset(srv->proxy, rs);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue