-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move embedded haproxy process to a distinct pid group #1136
Conversation
The embedded haproxy process is being created in the same pid group of the controller, which makes it receive the same signals received by the controller when running under a process supervisor. This makes haproxy be prematurely terminated when the controller is still shutting down.
@jcmoraisjr Don't we need to update
kill -USR1 $pid
Even for the haproxy-ingress/pkg/haproxy/instance.go Line 661 in 914b581
|
Hi, in fact this shouldn't make any difference because, when shutdown.sh is called, the controller process is being shutting down as well, dropping all the other process in that same container. So moving from term to usr1 would be a noop to the observer. I understand your concern, and I also think we've already discussed that on another issue, and the point here is that the correct place to configure a long living haproxy connection during rolling updates is not here, but instead making the controller to postpone its own shutdown. Moreover, this script belongs to a way to run haproxy which is being deprecated. master-worker is the new default from v0.15, and it calls haproxy directly without any help of external scripts. |
@jcmoraisjr Yeah, we discussed it earlier. I guess I understand now why |
I see your point. When running haproxy as a daemon we don't have a good control of the underlying process. In master worker mode we run it in the foreground, this gives us a few more options. Here is where the process is started, stopped, and asked to be stopped: haproxy-ingress/pkg/haproxy/instance.go Lines 632 to 667 in a7e4b1f
and here is the channel that makes the controller wait until haproxy is gone: haproxy-ingress/pkg/haproxy/instance.go Lines 402 to 423 in a7e4b1f
In this scenario it makes sense to send usr1 because the controller will wait for it. I'll give this a chance, maybe adding as a config option. Tks btw for bringing this scenario again and again =) |
@jcmoraisjr No worries; finally, we are on the same page. For now, with Please give the config option approach a shot; it would be helpful. Thanks! |
The embedded haproxy process is being created in the same pid group of the controller, which makes it receive the same signals received by the controller when running under a process supervisor. This makes haproxy be prematurely terminated when the controller is still shutting down.