-
I'm playing around with I've created a basic project with two executables called I'm starting both these processes in a container which is within a controller. They both write to the file as expected. Then I send SIGHUP to the parent process to restart the container in a way that would simulate a "blue green" deployment, but the old processes don't seem to stop. The files will now contain timestamps from two different processes. (On rare occasions, one of the old processes of either Not quite sure what I'm doing wrong here .... have I got something wrong with regard to notifying the status or something? I'd appreciate any guidance! I've attached a zip file with my code ... repro steps below. To reproduce
You'll see a Grab the pid for Then run: Open the log files again and you should see two different PIDs writing to the file simultaneously. I'd expect the old process to stop and the new process to take over. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Something does look a bit odd, let me investigate further. |
Beta Was this translation helpful? Give feedback.
Okay, a small update. The issue is that this library expects signals to be sent to the progress group, not a specific process.
The reason for this, is that this is the default behaviour of the terminal and IIUC, things like systemd.
In other words, we expect that SIGINT (or SIGwhatever) is sent to all the processes (process group), and the controller waits for them/expects them to exit. Because that doesn't happen, we end up with the new container running alongside the old container.
This isn't an ideal situation, and we should probably handle it better, but I confirmed it does work correctly when using process groups: