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!
Hello. 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? Thanks.
Seamless reloads basically means that you will not loose a single request, it allows for zero downtime restarts. The developer shares some more insights: https://www.haproxy.com/blog/truly-seamless-reloads-with-haproxy-no-more-hacks/
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. Thanks, Dmitry! 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: Author: demon Date: Fri Aug 24 19:19:27 UTC 2018 New revision: 477980 URL: https://svnweb.freebsd.org/changeset/ports/477980 Log: Add 'softreload' command for seamless haproxy reload (-x option). PR: 230305 Submitted by: Frank Wall <fw@moov.de> Changes: head/net/haproxy/files/haproxy.in head/net/haproxy-devel/files/haproxy.in
Patch committed, thanks! (sorry for the delay, I am on vacation).
A HUGE thank you, Dmitry! Enjoy your vacation!