Closed sepulworld closed 7 years ago
I found the issue and fixed it my fork...
line 49 of haproxy.go
err := cmd.Start() should be err := cmd.Run()
This will allow the process request to finish and prevents the defunct state.
Yes, you're right, thank you for your help. Can you do a PR?
I just noticed this one as well. Fixing the issue above still leaves lingering haproxy processes though. Need to look into this a bit more.
The issue is, the pid is not the pid of new haproxy process. The actual pid is pid + 1.
In haproxy.go
pid = cmd.Process.Pid + 1
When haproxy restarts note the old haproxy processes don't hang around.
In reality the pid probably won't always be cmd.Process.Pid + 1
though. A proper fix is needed. I'm out of time to look deeper tonight.
Hi,
I am seeing a bunch of defunct haproxy processes after configuration is reloaded. Is this expected?
root 3860 0.2 0.7 322952 7132 pts/0 Sl+ 05:27 0:00 /root/go/bin/hadiscover --config /etc/haproxy/haproxy.cfg.tpl --etcd http://localhost:4001 --ha /usr/sbin/haproxy --key service root 3866 0.0 0.0 0 0 pts/0 Z+ 05:27 0:00 [haproxy]
root 3885 0.0 0.0 0 0 pts/0 Z+ 05:28 0:00 [haproxy]
root 3892 0.0 0.0 0 0 pts/0 Z+ 05:28 0:00 [haproxy]
root 3910 0.0 0.0 0 0 pts/0 Z+ 05:33 0:00 [haproxy]
root 3911 0.0 0.0 0 0 pts/0 Z+ 05:33 0:00 [haproxy]
root 3912 0.0 0.0 0 0 pts/0 Z+ 05:33 0:00 [haproxy]
root 3913 0.0 0.0 0 0 pts/0 Z+ 05:33 0:00 [haproxy]
root 3914 0.0 0.0 0 0 pts/0 Z+ 05:33 0:00 [haproxy]
root 3915 0.0 0.0 0 0 pts/0 Z+ 05:33 0:00 [haproxy]
root 3916 0.0 0.0 0 0 pts/0 Z+ 05:33 0:00 [haproxy]
root 3917 0.0 0.0 0 0 pts/0 Z+ 05:33 0:00 [haproxy]
root 3918 0.0 0.0 0 0 pts/0 Z+ 05:33 0:00 [haproxy]
root 3919 0.0 0.0 0 0 pts/0 Z+ 05:33 0:00 [haproxy]
root 3920 0.0 0.0 0 0 pts/0 Z+ 05:33 0:00 [haproxy]
root 3921 0.0 0.0 0 0 pts/0 Z+ 05:34 0:00 [haproxy]
root 3922 0.0 0.0 0 0 pts/0 Z+ 05:34 0:00 [haproxy]
root 3923 0.0 0.0 0 0 pts/0 Z+ 05:34 0:00 [haproxy]
root 3924 0.0 0.0 0 0 pts/0 Z+ 05:34 0:00 [haproxy]
root 3925 0.0 0.0 0 0 pts/0 Z+ 05:34 0:00 [haproxy]
root 3926 0.0 0.0 0 0 pts/0 Z+ 05:34 0:00 [haproxy]
root 3927 0.0 0.0 0 0 pts/0 Z+ 05:34 0:00 [haproxy]
root 3928 0.0 0.0 0 0 pts/0 Z+ 05:34 0:00 [haproxy]
root 3929 0.0 0.0 0 0 pts/0 Z+ 05:34 0:00 [haproxy]
root 3930 0.0 0.0 0 0 pts/0 Z+ 05:34 0:00 [haproxy]
root 3931 0.0 0.0 0 0 pts/0 Z+ 05:34 0:00 [haproxy]
root 3932 0.0 0.0 0 0 pts/0 Z+ 05:34 0:00 [haproxy]
root 3933 0.0 0.0 0 0 pts/0 Z+ 05:34 0:00 [haproxy]
root 3934 0.0 0.0 0 0 pts/0 Z+ 05:34 0:00 [haproxy]
root 3935 0.0 0.0 0 0 pts/0 Z+ 05:34 0:00 [haproxy]
root 3936 0.0 0.2 12436 2856 pts/0 S+ 05:34 0:00 /usr/sbin/haproxy -f .haproxy.cfg -sf 3935
root 3938 0.0 0.2 11752 2272 pts/3 S+ 05:34 0:00 grep --color=auto haproxy