Created attachment 195774 [details]
patch for net/haproxy-devel
Starting with 1.8 HAProxy supports truly seamless reloads. This patch adds support for this new mode through the "softreload" command, which is a nice addition to the previously added "hardreload" command (#221402).
To be able to use the seamless reloads feature, a user needs to add the following configuration to haproxy.conf:
stats socket /var/run/haproxy/socket level admin expose-fd listeners
The path is configurable through the new $haproxy_socket variable.
If HAProxy is not configured for seamless reloads, HAProxy will issue a clear error message:
[ALERT] 213/214703 (18320) : Failed to get the sockets from the old process!
I always used "/usr/local/etc/rc.d/haproxy reload" to reload haproxy config and keep all currently serving requests.
Can you please explain a bit why this one is better?
Seamless reloads basically means that you will not loose a single request, it allows for zero downtime restarts.
The developer shares some more insights:
Well, after reading this article I got an impression that only Linux is affected, and
BSD had no problems with loosing connections on reload.
Anyway I have nothing against your patch (provided it does not change current behaviour), but I think we do not need it thought.
I'll commit it soon.
> I'll commit it soon.
To be clear with this, seamless reloads is a completely new feature. It greatly improves HAProxy's restart behaviour (on BSD and on Linux):
1. When triggering a restart, HAProxy first starts a new process
2. Next it will transfer all sockets from the old to the new process
3. Finally the old process is terminated
This way frequent configuration changes (restarts) become invisible to the users.
@Dmitry: Do you plan to commit the patch unmodified? Or do you want me to change anything?
A commit references this bug:
Date: Fri Aug 24 19:19:27 UTC 2018
New revision: 477980
Add 'softreload' command for seamless haproxy reload (-x option).
Submitted by: Frank Wall <email@example.com>
Patch committed, thanks!
(sorry for the delay, I am on vacation).
A HUGE thank you, Dmitry! Enjoy your vacation!