-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Refactor PIDFile.join()
#8
base: main
Are you sure you want to change the base?
Conversation
I'm a little unsure about this change. First thing is that But more importantly, I don't understand why the existing code is failing. When I run the tests on master with When I break into the process, I can see the test_signals.log looks like this:
It seems that at least on macOS, the asserted behavior just isn't happening. Sending SIGHUP is causing the process to restart and not shut down as expected. |
That's correct. It shouldn't shut down. SIGTERM should shut down the process, but SIGHUP should cause reload/restart and that's what it does. When the process receives SIGHUP, it first goes to a stopped state (with a PID file removed) and then it starts again (creating a PID file in the same location).
No, this test tries to catch a moment "in-between". When reload reached stop state but start hasn't created a PID file yet.
Right, I didn't think that it might be the original intent.
Fun fact: if you add |
4846960
to
60a41bb
Compare
5875b24
to
bdb836c
Compare
Co-authored-by: Jason R. Coombs <[email protected]>
bdb836c
to
698ba05
Compare
This patch works around an issue described in #7 by also comparing the stat of PID files. Otherwise it misses cases when PID file gets recreated faster that the check loop hits another existence check.
698ba05
to
905b42a
Compare
This may be partially fixing #7.