Marionette's processhandler for psutil should not wait for reader thread when calling `wait()` from within the `poll()` method (causing a 1s extra delay when starting the session)
Categories
(Testing :: Marionette Client and Harness, defect, P2)
Tracking
(firefox-esr115 unaffected, firefox125 unaffected, firefox126 unaffected, firefox127 fixed, firefox128 fixed)
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox125 | --- | unaffected |
firefox126 | --- | unaffected |
firefox127 | --- | fixed |
firefox128 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
(Regression)
Details
(Keywords: perf, perf-alert, regression, Whiteboard: [webdriver:m11])
Attachments
(2 files, 1 obsolete file)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
When running Marionette tests on MacOS these days it can be seen that there is a 1s delay between each and every test. After doing some investigation I can trace this back to using psutil. This feature was added over on bug 1884401 for Firefox 127.
Specifically the delay comes from calling this line in marionette.py:
returncode = self.instance.runner.returncode
And that then drills down to waiting for the reader thread to join in Marionette's own process handler for psutil:
After comparing to the mozprocess implementation I can see that this one doesn't call into wait()
for poll()
, which means that we never try to join the reader threads and that the poll()
method returns immediately.
Assignee | ||
Comment 1•29 days ago
|
||
Actually the poll()
method is not available when the process handler is observing an external process like Firefox after a restart. That means we have to continue using wait()
but potentially should not wait for the reader thread to have joined.
Assignee | ||
Comment 2•29 days ago
|
||
Assignee | ||
Updated•26 days ago
|
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/78ea7783f16f [marionette] Don't wait for reader thread when polling psutil process. r=webdriver-reviewers,jgraham
Comment 4•26 days ago
|
||
bugherder |
Comment 5•24 days ago
|
||
The patch landed in nightly and beta is affected.
:whimboo, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox127
towontfix
.
For more information, please visit BugBot documentation.
Assignee | ||
Comment 6•24 days ago
|
||
Comment on attachment 9401088 [details]
Bug 1896106 - [marionette] Don't wait for reader thread when polling psutil process.
Beta/Release Uplift Approval Request
- User impact if declined: Users of Marionette on MacOS will expect a 1s delay at the beginning of each test that gets run, which can accumulate quite a lot of time
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Detecting if a process is running doesn't need to wait for the readers of stdout and stderr to wait. This patch just removed these parts and made it equal to what subprocess is running.
- String changes made/needed: No
- Is Android affected?: No
Comment 7•24 days ago
|
||
Perfherder has detected a awsy performance change from push 78ea7783f16f564aa8886dd8e51b42c2971c508b.
Improvements:
Ratio | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|
10% | Images | macosx1015-64-shippable-qr | fission tp6 | 6,642,001.27 -> 5,979,633.87 |
Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.
If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a sheriff to do that for you.
You can run these tests on try with ./mach try perf --alert 221
For more information on performance sheriffing please see our FAQ.
Assignee | ||
Comment 8•23 days ago
|
||
Assignee | ||
Comment 9•23 days ago
|
||
Updated•23 days ago
|
Comment 10•23 days ago
|
||
beta Uplift Approval Request
- User impact if declined: Users of Marionette on MacOS will expect a 1s delay at the beginning of each test that gets run, which can accumulate quite a lot of time
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: None
- Risk associated with taking this patch: Low
- Explanation of risk level: Detecting if a process is running doesn't need to wait for the readers of stdout and stderr to wait. This patch just removed these parts and made it equal to what subprocess is running.
- String changes made/needed: No
- Is Android affected?: no
Updated•23 days ago
|
Assignee | ||
Updated•23 days ago
|
Updated•23 days ago
|
Updated•23 days ago
|
Comment 11•23 days ago
|
||
uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/a548794aa51a
Description
•