Ensure that an "Extension Suspend" profiler marker is also collected when an extension suspend a request but didn't resumed it yet
Categories
(WebExtensions :: Request Handling, enhancement, P3)
Tracking
(firefox95 fixed)
| Tracking | Status | |
|---|---|---|
| firefox95 | --- | fixed |
People
(Reporter: rpl, Assigned: rpl)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
The network "Extension Suspent" profiler markers introduced some times ago from Bug 1625006 are currently added from the ChannelWrapper::Resume method.
Unfortunately this also means that there will be no "Extension Suspend" marker in a Gecko profile collected before the suspended web request has been resumed.
The extension may even be never resuming the request (e.g. an exception that the extension may not be expecting may have prevented the extension from resolving a promise returned from a blocking webRequest listener, which would leave the request suspended for the entire lifetime of that extension), and it would be helpful to be able to see if that is happening while investigating an issue through a Gecko profile.
This issue goal is to look into the changes needed to make sure we add the marker when the request has been suspended, and then another marker from the resume method to close the marker interval (starting from the pointers Florian provided me some times ago when we briefly discussed about this issue, in particular the way nsDOMNavigationTiming.cpp is adding this kind of markers here).
| Assignee | ||
Comment 1•4 years ago
|
||
| Assignee | ||
Comment 2•4 years ago
|
||
Test extension and scenario
This attachment contains a small test extension I used to collect some sample profiles with and without the changes to the "Extension Suspend" profiler marker attached to this bug.
The extension intercepts with a blocking webRequest listener of main_frame requests for developer.mozilla.org urls, and provide a browserAction button with a few actions (suspend all intercepted requests, resume/cancel/redirect all suspended requests).
The scenario manually recreated while collecting the two sample profiles that follows:
- install the attached test extension temporarily
- open 4 tabs with developer.mozilla.org url loaded in all of them
- start the Gecko Profiler
- open the test extension browserAction popup and click "suspend all requests" button
- reload the first tab, and after a few seconds click "resume all suspended requests" button in the browserAction popup, then click "suspend all requests" again
- reload the second tab, and after a few seconds click "cancel all suspended requests" in the browserAction popup, then click "suspend all requests" again
- reload the third tab, and after a few seconds click "redirect all suspended requests" in the browserAction popup, then click "suspend all requests" again
- reload the forth tab, and after a few seconds capture the profile without resuming the suspended channel
Profiles Collected (with and without the attached patch)
The following are two profiles collected with and without the attached patch:
-
sample profile without the changes attached
- the forth suspended request, the one never resumed, does not have an
Extension Suspendmarker and so it isn't clear in the profile what was preventing the Network Request to complete - the
Extension Suspendmarker also include in the text if the request was canceled or redirected, but it can't tell us exactly which was of the extension did cancel or redirect it (because the marker does always include the list of all suspenders)
- the forth suspended request, the one never resumed, does not have an
-
sample profile with the changes attached
- the forth suspended request has an
Extension Suspendmarker without an end (suggesting us that the marker for theNetwork Requeststhat also doesn't have an end timestamp and overlaps the Extension Suspend marker is due to the extension) Extension CancelandExtension Redirectare separate marker, in this case they tell us exactly which extension was responsible for the request being canceled or redirected (with the previous markers we always include the entire list of suspenders, without specify which one canceled or redirected the request)
- the forth suspended request has an
Updated•4 years ago
|
Updated•4 years ago
|
Comment 4•4 years ago
|
||
| bugherder | ||
Description
•