deal with unresponsive content processes in ChromeUtils.requestPerformanceMetrics()

RESOLVED FIXED in Firefox 64

Status

()

enhancement
RESOLVED FIXED
8 months ago
8 months ago

People

(Reporter: tarek, Assigned: tarek)

Tracking

unspecified
mozilla64
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox64 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

8 months ago
Right now a call to ChromeUtils.requestPerformanceMetrics() waits for all content process to return their data. But if one is unresponsive (slow script, etc.) it will hold the promise.

We need to deal with this issue, and if possible report back on which content process is acting out, so about:performance can use that information
Assignee

Updated

8 months ago
Assignee: nobody → tarek
Assignee

Comment 1

8 months ago
Adds a timout that will resolve the promise to return even if we did not get an answer from
all children.

MozReview-Commit-ID: FFLwAUkkYos
Assignee

Comment 2

8 months ago
Florian, unfortunately I have not found a good mechanism in IPC to mock the delay in content process or workers.

Could you give us your STRs this issue so we can manually verify that the timeout is correctly triggered ?

Thanks
Flags: needinfo?(florian)
(In reply to Tarek Ziadé (:tarek) from comment #2)

> Could you give us your STRs this issue so we can manually verify that the
> timeout is correctly triggered ?

A page containing this piece of JS should make its content process unresponsive:

function fn() {
  let start = Date.now();
  while (Date.now() - start < 5000)
    ; // do nothing
  setTimeout(fn, 0);
}
fn();

It should be possible to cover this with an automated test, right?
Flags: needinfo?(florian)
Assignee

Comment 4

8 months ago
Before commenting here I tried a similar test with workers but could not get it to work. 

Your example seems to work though, thanks a lot! working on adding that
Assignee

Updated

8 months ago

Comment 8

8 months ago
Pushed by tziade@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8958a60dd824
deal with unresponsive content processes in ChromeUtils.requestPerformanceMetrics() - r=baku

Comment 9

8 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/8958a60dd824
Status: NEW → RESOLVED
Last Resolved: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.