-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Check process existence when listing nbserver processes #6099
Conversation
Nice. 👍 |
try: | ||
os.unlink(file) | ||
except OSError: | ||
pass # TODO: This should warn or log or something |
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.
Yes, probably.
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.
do you want to actually log something here, or should we merge as is ?
Looking forward to using the new nbopen and related functionality!
Just a note that the |
Check process existence when listing nbserver processes
Weren't there some |
Whenever it's clear what warning/logging it should do, anyone can add that later. |
Check process existence when listing nbserver processes
While implementing nbopen, I realised that listing the available nbservers gave me info for a dozen servers that had died without cleaning up their info. This implements a simple check that a process with the given pid exists. This isn't perfect, because another process could be reusing the same pid, but the chances of that are fairly low, and it can't give a false negative, as far as I know.
I haven't tried to implement a .NET version of check_pid for the
_process_cli
module. The ctypes version for Windows is taken from code inIPython.parallel
- this is simplified to use the new utility function.