Open Bug 1885431 Opened 1 year ago Updated 1 year ago

[mozprocess] Consider using the "psutil" Python package in mozprocess

Categories

(Testing :: Mozbase, enhancement)

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.

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?

Flags: needinfo?(mh+mozilla)

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.

Attachment #9391346 - Attachment is obsolete: true
Attachment #9391345 - Attachment is obsolete: true

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.

No longer blocks: 1884401
Depends on: 1884401
Flags: needinfo?(mh+mozilla)
Depends on: 1887666
No longer depends on: 1884401
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: