completion. The main objective is to limit the number of connections opening
and closure on a specific server. This feature is compatible only with
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
check connect option is defined, either on the server line or via a custom
struct server *srv, struct proxy *be,
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,
struct session *sess,
struct sockaddr_storage *src,
/* Returns backend reuse policy depending on <be>. It can be forced to always
* 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) {
/* Override reuse-mode if reverse-connect is used. */
}
}
-/* Reports a diag if check-reuse-pool is active while backend check ruleset is
- * non HTTP.
+/* Reports a diag if check-reuse-pool is active but incompatible with the
+ * backend configuration.
*/
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",
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);
+ }
}
}