docker-library / haproxy

Docker Official Image packaging for HAProxy
http://www.haproxy.org/
GNU General Public License v2.0
347 stars 158 forks source link

Haproxy not reloading config in docker #220

Closed SamMousa closed 10 months ago

SamMousa commented 10 months ago

I'm running haproxy inside docker using Nomad as an orchestrator.

Nomad renders templates, one of them is the config haproxy.cfg.

When cluster state changes this config file is updated and a signal is sent to haproxy. The logs show it is reloading:

[NOTICE]   (1) : Reloading HAProxy
[NOTICE]   (1) : haproxy version is 2.8.3-86e043a
[ALERT]    (1) : socketpair: Cannot transfer the fd 10 over sockpair@4. Giving up.
[ALERT]    (1) : Failed to get the sockets from the old process!
[NOTICE]   (1) : New worker (188) forked
[NOTICE]   (1) : Loading success.
[NOTICE]   (1) : haproxy version is 2.8.3-86e043a
[WARNING]  (1) : Former worker (166) exited with code 137 (Killed)

However the new configuration is not applied. I found an issue from 2016 related to inodes, but I don't think that is the problem.

Getting a shell into the container I can confirm:

Could it be that haproxy has a reference / file descriptor open to the old inode and therefore is not picking up the changes?

SamMousa commented 10 months ago

Hmm, never mind, seems was mounting the config file twice one time via the inode. Apologies for the spam!