Open ribalba opened 1 year ago
@ArneTR @djesic @dan-mm Feedback welcome.
The process must exist in order to make this call.
Typically the process is just created in start_profiling.
When this method is overwritten this indicates that you do not want to leverage the standard process launcher mechanism of the class and thus do not need its handling in terms of blocking and killing.
We have a refactoring coming up that allows to more flexibly use the start_profiling class by giving the process-filename to invoke in the class variables.
I guess I would leave the set_blocking call in the base functionality then. or?
Somehow network was slow in the train and my old version got posted. I noticed this needed to be solved differently half way through typing the issue. But you are right in that if someone overwrites the method they might want it to be blocking.
Currently we set
os.set_blocking(self._ps.stderr.fileno(), False)
at the end of thestart_profiling
method. As seen today this might cause problems if people extend the method as it could be forgotten. I would suggest to wrap it into a watcher and set it as soon as_ps
is set. Also we don't need to think about adding it when overwriting thestart_profiling
. Ideas?