MAJOR: init: start all listeners via protocols and not via proxies anymore
authorWilly Tarreau <w@1wt.eu>
Wed, 2 Sep 2020 09:11:43 +0000 (11:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 2 Sep 2020 09:11:43 +0000 (11:11 +0200)
commite91bff213485e495a12f7576e39f423b3fe10244
tree4f21727729ee48696decb1aac18c996e50321cd5
parent576a6338683c88febaf26e8a49e403a6a6153ab8
MAJOR: init: start all listeners via protocols and not via proxies anymore

Ever since the protocols were added in 1.3.13, listeners used to be
started twice:
  - once by start_proxies(), which iteratees over all proxies then all
    listeners ;
  - once by protocol_bind_all() which iterates over all protocols then
    all listeners ;

It's a real mess because error reporting is not even consistent, and
more importantly now that some protocols do not appear in regular
proxies (peers, logs), there is no way to retry their binding should
it fail on the last step.

What this patch does is to make sure that listeners are exclusively
started by protocols. The failure to start a listener now causes the
emission of an error indicating the proxy's name (as it used to be
the case per proxy), and retryable failures are silently ignored
during all but last attempts.

The start_proxies() function was kept solely for setting the proxy's
state to READY and emitting the "Proxy started" message and log that
some have likely got used to seeking in their logs.
include/haproxy/protocol.h
include/haproxy/proxy.h
src/haproxy.c
src/protocol.c
src/proxy.c