From: Amaury Denoyelle Date: Tue, 21 Sep 2021 09:51:54 +0000 (+0200) Subject: MINOR: server: enable slowstart for dynamic server X-Git-Tag: v2.5-dev8~159 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd8a6f28c6d80ffe5eadf683ae878d302b9c5984;p=thirdparty%2Fhaproxy.git MINOR: server: enable slowstart for dynamic server Enable the 'slowstart' keyword for dynamic servers. The slowstart task is allocated in 'add server' handler if slowstart is used. As the server is created in disabled state, there is no need to start the task. The slowstart task will be automatically started on the first 'enable server' invocation. --- diff --git a/doc/management.txt b/doc/management.txt index 64172e5a99..f0c28a4902 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -1548,6 +1548,7 @@ add server / [args]* - send-proxy-v2 - send-proxy-v2-ssl - send-proxy-v2-ssl-cn + - slowstart - sni - source - ssl diff --git a/src/server.c b/src/server.c index d770bdd3b0..213d10632e 100644 --- a/src/server.c +++ b/src/server.c @@ -1673,7 +1673,7 @@ static struct srv_kw_list srv_kws = { "ALL", { }, { { "resolvers", srv_parse_resolvers, 1, 1, 0 }, /* Configure the resolver to use for name resolution */ { "send-proxy", srv_parse_send_proxy, 0, 1, 1 }, /* Enforce use of PROXY V1 protocol */ { "send-proxy-v2", srv_parse_send_proxy_v2, 0, 1, 1 }, /* Enforce use of PROXY V2 protocol */ - { "slowstart", srv_parse_slowstart, 1, 1, 0 }, /* Set the warm-up timer for a previously failed server */ + { "slowstart", srv_parse_slowstart, 1, 1, 1 }, /* Set the warm-up timer for a previously failed server */ { "source", srv_parse_source, -1, 1, 1 }, /* Set the source address to be used to connect to the server */ { "stick", srv_parse_stick, 0, 1, 0 }, /* Enable stick-table persistence */ { "tfo", srv_parse_tfo, 0, 1, 1 }, /* enable TCP Fast Open of server */ @@ -4660,6 +4660,10 @@ static int cli_parse_add_server(char **args, char *payload, struct appctx *appct srv->agent.state &= ~CHK_ST_ENABLED; } + /* Init slowstart if needed. */ + if (init_srv_slowstart(srv)) + goto out; + /* Attach the server to the end of the proxy linked list. Note that this * operation is not thread-safe so this is executed under thread * isolation.