Closed Bug 1491816 Opened 2 years ago Closed 2 years ago

deal with unresponsive content processes in ChromeUtils.requestPerformanceMetrics()

Categories

(Toolkit :: Performance Monitoring, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: tarek, Assigned: tarek)

References

Details

Attachments

(1 file)

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: nobody → tarek
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
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)
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
Pushed by tziade@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8958a60dd824
deal with unresponsive content processes in ChromeUtils.requestPerformanceMetrics() - r=baku
https://hg.mozilla.org/mozilla-central/rev/8958a60dd824
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.