-
-
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]>
698ba05
to
905b42a
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.
905b42a
to
99cef5f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid I don't have much more to add here. I've lost context on the issue and I was obviously struggling with it to begin with. I'm a little uneasy with the added complexity, but if it's the necessary complexity to be stable, I guess it's worth it.
I'll defer to your judgment.
I remember thinking that this felt like the way to go, in terms what the original intent seemed like. I guess I could double check and merge. |
This may be partially fixing #7.