[mozprocess] Consider using the "psutil" Python package in mozprocess
Categories
(Testing :: Mozbase, enhancement)
Tracking
(Not tracked)
People
(Reporter: whimboo, Unassigned)
References
(Depends on 1 open bug)
Details
Attachments
(2 obsolete files)
Instead of overriding the process implementation of subprocess we could use psutil instead. It has a quite fantastic range of features on top of what subprocess offers. A clear requirement would be to keep the support for all the features that we currently have, including the way to keep track of restarted browser processes.
The downside is that it requires platform specific binary components which most likely will get built on the consumers machine. This would make it harder to correctly vendor into mozilla-central.
Lets experiment with psutil to figure out if it would be a good replacement.
| Reporter | ||
Comment 1•1 year ago
|
||
| Reporter | ||
Comment 2•1 year ago
|
||
Depends on D204696
| Reporter | ||
Comment 3•1 year ago
|
||
Currently I'm not able to push these changes to try given that whenever I run mach try fuzzy the vendored in copy of psutil is getting deleted and the tree is dirty.
Glandium mentioned that also mach is using mozprocess and switching to psutil means we have a module that uses native code in our tree and this will cause problems. But would installing it from pypi (or our internal mirror) be an option?
Comment 4•1 year ago
|
||
Comment on attachment 9391346 [details]
WIP: Bug 1885431 - [mozprocess] Replace custom Popen class with psutil.
Revision D204697 was moved to bug 1884401. Setting attachment 9391346 [details] to obsolete.
Updated•1 year ago
|
| Reporter | ||
Comment 5•1 year ago
|
||
Given that vendoring is not wanted as it looks like we went ahead and decided to use a custom process_class for just Marionette at the moment. This allows us to install psutil from the internal pypi mirror. A working patch got attached on bug 1884401.
Updated•1 year ago
|
| Reporter | ||
Updated•1 year ago
|
Comment 6•1 year ago
|
||
Something to consider: When mach initialises itself it deletes the psutil folder, if found, in /third_party/python/psutil
Description
•