-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
When aw-qt crashes, aw-watcher-afk does not shut down #19
Comments
Yeah, I tried using a process group for this but I'm not that familiar with that part of POSIX.
|
It seems that A solution to prevent double-running processes would be to run a process check upon start and see if any Also, from Wikipedia:
SIGKILL is notably missing from that list. |
Here's a proposal for this |
Closing this since it only happens in the case of |
No, it does not only happen for |
Oh, fair enough. I think this depends on how Python crashes, if Python crashes with an internal error (possible that PyQt triggers this) instead of a normal Exception-caused crash then I'm not sure we can do much about it. If it crashes "normally" then I think the |
Once This can be done in this way in Python.
This kills the watchers when Then I've been looking for the proper way to terminate the watchers, and while PR will come in as soon as I figure a proper git way out of my local mess (I've been adding Some other solution using prctlAnother solution involves prctl : python-prctl is a thing, if someone wants to go that way. And this track was yet another option but led nowhereOtherwise, per section 10.6.4 in this document, supposedly all orphaned process groups receive a Note that even if all I did works fine, |
@nikanar Awesome! Much better solution than my suggestion. Out of the 3 solutions you found the one you selected was clearly most clean. Will also work nicely even if the watchers are not run with aw-qt. Will check the PRs and merge :) Thanks for the help! |
Amazing work, learned a lot from reading those links. But, as I mentioned in comments on the PRs, there might be an issue with the taken approach when run using the PyInstaller binaries. I'm confident we can find a way around that however. |
Continued discussions should probably go here. So, @nikanar did a nice fix with the PPID detection but I don't think that'll work with PyInstaller due to it using a bootloader process that in turn starts the application process. Details here: https://pythonhosted.org/PyInstaller/advanced-topics.html#the-bootstrap-process-in-detail The process tree would look something like this when run using the PyInstaller (iirc):
As specified in the PyInstaller docs, the bootloader will exit when its child process exits. There has been talk about moving the child processes into Python-managed processes or threads (this would get rid of all the secondary bootloader and is likely to save some memory), but this has not been investigated. |
If that's right, then when running under PyInstaller, the children should look for the PPID of their parent process (the PyInterpreter) to see if that is 1 because aw-qt died. But then, I also have no idea if |
Set up deployment of release builds with Travis
Really odd behavior.
Reproducible by starting aw-qt and then doing "kill -9" on the aw-qt process.
The text was updated successfully, but these errors were encountered: