MINOR: check: clarify check-reuse-pool interaction with reuse policy

check-reuse-pool can only perform as expected if reuse policy on the
backend is set to aggressive or higher. Update the documentation to
reflect this and implement a server diag warning.
This commit is contained in:
Amaury Denoyelle 2025-11-13 17:45:18 +01:00
parent 52a7d4ec39
commit 8415254cea
4 changed files with 11 additions and 3 deletions

View File

@ -17831,6 +17831,8 @@ check-reuse-pool
completion. The main objective is to limit the number of connections opening completion. The main objective is to limit the number of connections opening
and closure on a specific server. This feature is compatible only with and closure on a specific server. This feature is compatible only with
http-check rulesets. It is silently ignored for other check types. http-check rulesets. It is silently ignored for other check types.
Furthermore, reuse policy should be set to aggressive on the backend as each
check attempt is performed over a dedicated session.
For configuration simplicity, this option is silently ignored if any specific For configuration simplicity, this option is silently ignored if any specific
check connect option is defined, either on the server line or via a custom check connect option is defined, either on the server line or via a custom

View File

@ -46,6 +46,8 @@ int alloc_bind_address(struct sockaddr_storage **ss,
struct server *srv, struct proxy *be, struct server *srv, struct proxy *be,
struct stream *s); struct stream *s);
int be_reuse_mode(const struct proxy *be, const struct server *srv);
int64_t be_calculate_conn_hash(struct server *srv, struct stream *strm, int64_t be_calculate_conn_hash(struct server *srv, struct stream *strm,
struct session *sess, struct session *sess,
struct sockaddr_storage *src, struct sockaddr_storage *src,

View File

@ -1555,7 +1555,7 @@ kill_random_idle_conn(struct server *srv)
/* Returns backend reuse policy depending on <be>. It can be forced to always /* Returns backend reuse policy depending on <be>. It can be forced to always
* mode if <srv> is not NULL and uses reverse HTTP. * mode if <srv> is not NULL and uses reverse HTTP.
*/ */
static int be_reuse_mode(struct proxy *be, struct server *srv) int be_reuse_mode(const struct proxy *be, const struct server *srv)
{ {
if (srv && srv->flags & SRV_F_RHTTP) { if (srv && srv->flags & SRV_F_RHTTP) {
/* Override reuse-mode if reverse-connect is used. */ /* Override reuse-mode if reverse-connect is used. */

View File

@ -65,8 +65,8 @@ static void srv_diag_cookies(int *ret, struct server *srv, struct eb_root *cooki
} }
} }
/* Reports a diag if check-reuse-pool is active while backend check ruleset is /* Reports a diag if check-reuse-pool is active but incompatible with the
* non HTTP. * backend configuration.
*/ */
static void srv_diag_check_reuse(int *ret, struct server *srv, struct proxy *px) static void srv_diag_check_reuse(int *ret, struct server *srv, struct proxy *px)
{ {
@ -75,6 +75,10 @@ static void srv_diag_check_reuse(int *ret, struct server *srv, struct proxy *px)
diag_warning(ret, "parsing [%s:%d] : 'server %s': check-reuse-pool is ineffective for non http-check rulesets.\n", diag_warning(ret, "parsing [%s:%d] : 'server %s': check-reuse-pool is ineffective for non http-check rulesets.\n",
srv->conf.file, srv->conf.line, srv->id); srv->conf.file, srv->conf.line, srv->id);
} }
else if (be_reuse_mode(px, srv) < PR_O_REUSE_AGGR) {
diag_warning(ret, "parsing [%s:%d] : 'server %s': check-reuse-pool is ineffective due to http-reuse policy.\n",
srv->conf.file, srv->conf.line, srv->id);
}
} }
} }