-
Notifications
You must be signed in to change notification settings - Fork 43
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
Implement two step shutdown with sigint #249
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #249 +/- ##
==========================================
- Coverage 99.15% 98.94% -0.21%
==========================================
Files 26 26
Lines 3550 3619 +69
Branches 256 259 +3
==========================================
+ Hits 3520 3581 +61
- Misses 18 24 +6
- Partials 12 14 +2
Continue to review full report at Codecov.
|
More changes:
@Peque Let me know how much you disagree with me 😄 |
@Peque Is this a good moment to go on with this? This should be rebased on top of the appveyor integration, by the way, I don't trust Windows signals whatsoever. |
@ocaballeror Let us first improve the current Windows CI integration (combine coverage reports, fix tests currently failing, see if we can skip less tests...). Trying to tackle this now would only add more noise to the currently incomplete Windows support. |
@Peque Shall we take a look at this again? |
@ocaballeror Sure. I will review this this week. |
@ocaballeror Before reviewing this, would you mind rebasing against |
This will have to be rebased so as to clean the mess. In this commit are the settings which I have been using to try a clean shutdown with Ctrl + C. The idea behind it is, launch `python test.py` from a console and then kill it with Ctrl + C. We can see that the daemon is the first one who gets the signal, and right now it prevents the processes from getting it. By reverting the changes in nameserver.py:92, we can see that the problem is that we are not able to locate the NS after Ctrl + C, so the NameServerProcess cannot know when all agents have been successfully shutdown. Further investigation is required.
7a601a3
to
c03435f
Compare
I didn't realize Windows compatibility was still not a thing when we started implemented this, so it will require a bit of work. What I found from a few minutes of playing around with this is that:
|
Fixes #60
Here's a quick rundown of the changes:
terminate
on itself from the sigint handler because._popen
seems to be undefined when accessed from a different process. Right now it seems the NameserverProcess is being terminated anyway (the tests would block otherwise, and there's no zombie python process afterwards), but I'm not entirely sure how or why.