MINOR: proxy: add a global "grace" directive to postpone soft-stop
authorWilly Tarreau <w@1wt.eu>
Tue, 7 Sep 2021 08:49:45 +0000 (10:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Sep 2021 15:34:29 +0000 (17:34 +0200)
commit10080716bfa76380a7b93c4d0ff4081301fada0c
treeeeaf587268673976dcef129b20f6fa7783bfafed
parentb7308f00cb03e5accd2f6092bf09fc2ac1360ff9
MINOR: proxy: add a global "grace" directive to postpone soft-stop

In ticket #1348 some users expressed some concerns regarding the removal
of the "grace" directive from the proxies. Their use case very closely
mimmicks the original intent of the grace keyword, which is, let haproxy
accept traffic for some time when stopping, while indicating an external
LB that it's stopping.

This is implemented here by starting a task whose expiration triggers
the soft-stop for real. The global "stopping" variable is immediately
set however. For example, this below will be sufficient to instantly
notify an external check on port 9999 that the service is going down,
while other services remain active for 10s:

    global
      grace 10s

    frontend ext-check
      bind :9999
      monitor-uri /ext-check
      monitor fail if { stopping }
doc/configuration.txt
include/haproxy/global-t.h
src/proxy.c