-
Notifications
You must be signed in to change notification settings - Fork 8
Monitor processes in the Pool for process changes #110
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
base: main
Are you sure you want to change the base?
Monitor processes in the Pool for process changes #110
Conversation
Psutil is so much easier to use than the python stdlib equivalents relating to getting the PIDs of child processes. This should not be a problem to install on conda-forge or even from PyPI these days. RE:natcap#109
This allows for easier access to the state of the Graph. RE:natcap#109
It turns out that psutil was not needed for this solution. RE:natcap#109
It turned out that my modifications to this were not needed. RE:natcap#109
Hey @phargogh, this seems straightforward but I want to just double check why you need to do this to just double check this is right solution? Thinking on a long arc, it is technically possible for process pools to shut down and restart processes if |
Thanks for taking a look at this, @richpsharp ! So, the main issue here is that I'm currently working around the lack of Because I'm unable to handle
Yes, the situation where this arises is when I'm operating on a memory-constrained environment like Sherlock, where I have to request a certain amount of memory available for my process. If one of my |
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.
Thanks @phargogh. This workaround for what you laid out in response to @richpsharp good questions makes sense to me. I'll hold off on a merge for Rich to take another look.
I'm currently evaluating whether a move to |
This PR monitors changes to the PIDs of workers in the TaskGraph's
multiprocessing.Pool
, so that if a worker is terminated for any reason, the whole graph is terminated and we log an error message. This avoids a deadlock resulting from events never being triggered that would allow task callables to execute.