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.
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;
}
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);
}
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);
}