Closed Bug 1567222 Opened 5 years ago Closed 3 years ago

[network markers] Network loads that went to a service worker never get a "stop" marker in the content process

Categories

(Core :: Gecko Profiler, defect, P2)

defect

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox70 --- wontfix
firefox90 --- fixed

People

(Reporter: mstange, Assigned: julienw)

References

(Blocks 1 open bug)

Details

Attachments

(12 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Profile: https://perfht.ml/2O2Ck0o

Steps to reproduce:

  1. Make sure you have an up-to-date service worker for https://profiler.firefox.com/ installed by going to that address, waiting a bit, and then clicking the reload button if it appears.
  2. Close all profiler.firefox.com tabs.
  3. Start the profiler.
  4. Open a tab and go to profiler.firefox.com .
  5. Wait for it to load.
  6. Capture a profile.

Expected results:
The network track in the content process should correctly show that the network was inactive once the page has loaded. And the panel should have network load bars that end at the right time.

Actual results:
https://perfht.ml/2O2Ck0o
Many network loading bars in the content process are extended to the very end of the visible range, implying that the network loads hadn't completed at the time the profile was captured.

Is this because some network markers may be generated on threads that are not being profiled?

Priority: -- → P2

Thanks for the bug Markus! Indeed this is something I sensed in bug 1541360 without really reproducing. Also I was seeing the problem mostly on parent processes, but in your example profile we clearly see the problem happens also on child processes.

NI myself to check if this is still happening.

Flags: needinfo?(felash)

Yes, this still does happen. I captured the profile [1] using the exact STR above using latest Nightly.
Some interesting bits: the parent process and the child process do not show the same data. This probably exhibits 2 different bugs.

Parent process:

  • all requests to profiler.firefox.com probably got their "start" marker but not the end.
  • requests to www.google-analytics.com also exhibit a weird behavior where they're all duplicated, but one of the duplication only has the "start" marker. Do they have a service worker too?

Content process:

  • all requests to profiler.firefox.com got their "end" marker but not their "start" marker.
  • requests to www.google-analytics.com also show a weird behavior where they're all redirected... to the same URL.

The devtools' network monitor seem to show the right data:

[1] https://perfht.ml/3bcmPdt

Hey Andrew, I've been told you could maybe help us for the issues that are part of dealing with a Service Worker. It would be good enough to have some information about how the flow is different in necko when the requests are served by a SW, so that maybe we can do the fix ourselves.

Also it may be a good idea to wait until the rewriting is done, but I don't know about the timeframe so we may want to do it before too, so some information about that would be very useful :-)

Thanks!

Flags: needinfo?(felash) → needinfo?(bugmail)

We discussed about this with Andrew, so I'm removing this needinfo. Also I'm working on this these days.

Assignee: nobody → felash
Flags: needinfo?(bugmail)
Keywords: leave-open
Pushed by jwajsberg@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/91df7c6b51d4
Add a LOAD_STOP marker when a request goes through a service worker r=asuth,necko-reviewers,valentin,gerald
https://hg.mozilla.org/integration/autoland/rev/777690075644
Improve profiler tests for the service worker case r=canaltinova
See Also: → 1704877

This is simplifying how we pass the URI, and this is abstracting how we
pass the size.
In general the goal is to use properties and methods from
HttpBaseChannel, so that maybe in the future we could abstract marker
handling to that parent class.

Depends on D112211

Attachment #9216132 - Attachment description: Bug 1567222 - Add a test with a serviceworker that doesn't call respondWith r=canaltinova!,asuth! → Bug 1567222 - Add redirect markers when respondWith isn't called in the service worker's fetch handler r=canaltinova!,asuth!
Attachment #9216132 - Attachment description: Bug 1567222 - Add redirect markers when respondWith isn't called in the service worker's fetch handler r=canaltinova!,asuth! → Bug 1567222 - Add a test with a serviceworker that doesn't call respondWith r=canaltinova!,asuth!
Attachment #9216132 - Attachment description: Bug 1567222 - Add a test with a serviceworker that doesn't call respondWith r=canaltinova!,asuth! → Bug 1567222 - Add redirect markers when respondWith isn't called in the service worker's fetch handler r=canaltinova!,asuth!
Keywords: leave-open

New try: https://treeherder.mozilla.org/jobs?repo=try&revision=d6fa64daedc523b457e4a8d2f01d6f6e2ffe6540

This time, there's no intermittent left. The issue with tsan is weird given that all tests are skipped.

last try after rebase and beforel anding: https://treeherder.mozilla.org/#/jobs?repo=try&revision=3c2e0ba3bf7894cdef4e3582534fb1e11301cab0

If everything's fine I'll land the sequence of patches!

Attachment #9216122 - Attachment description: Bug 1567222 - Improve the profiler's serviceworker tool to make it easier to install different serviceworker implementations r=canaltinova! → Bug 1567222 - [profiler] Improve the profiler's serviceworker tool to make it easier to install different serviceworker implementations r=canaltinova!
Attachment #9216123 - Attachment description: Bug 1567222 - Small changes to the caching serviceworker profiler marker test r=canaltinova! → Bug 1567222 - [profiler] Small changes to the caching serviceworker profiler marker test r=canaltinova!
Attachment #9216124 - Attachment description: Bug 1567222 - Report service worker install errors, so that tests don't timeout r=canaltinova! → Bug 1567222 - [profiler] Report service worker install errors, so that tests don't timeout r=canaltinova!
Attachment #9216125 - Attachment description: Bug 1567222 - Improve the reporting of objectContainsOnly in case of failures r=canaltinova! → Bug 1567222 - [profiler] Improve the reporting of objectContainsOnly in case of failures r=canaltinova!
Attachment #9216126 - Attachment description: Bug 1567222 - In tests, make the network markers filter more generic r=canaltinova! → Bug 1567222 - [profiler] In tests, make the network markers filter more generic r=canaltinova!
Attachment #9216127 - Attachment description: Bug 1567222 - Change the test utility to find the service worker thread, using a profiler marker r=canaltinova! → Bug 1567222 - [profiler] Change the test utility to find the service worker thread, using a profiler marker r=canaltinova!
Attachment #9216128 - Attachment description: Bug 1567222 - Change how we pass a few properties to the network markers r=valentin! → Bug 1567222 - [profiler, network] Change how we pass a few properties to the network markers r=valentin!
Attachment #9216130 - Attachment description: Bug 1567222 - Add a test with a serviceworker that has no fetch handlers r=canaltinova! → Bug 1567222 - [profiler] Add a test with a serviceworker that has no fetch handlers r=canaltinova!
Attachment #9216132 - Attachment description: Bug 1567222 - Add redirect markers when respondWith isn't called in the service worker's fetch handler r=canaltinova!,asuth! → Bug 1567222 - [profiler] Add redirect markers when respondWith isn't called in the service worker's fetch handler r=canaltinova!,asuth!
Attachment #9216133 - Attachment description: Bug 1567222 - Add a test to check network markers for synthetized responses from a service worker r=canaltinova! → Bug 1567222 - [profiler] Add a test to check network markers for synthetized responses from a service worker r=canaltinova!
Pushed by jwajsberg@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9259b30793f8
[profiler] Improve the profiler's serviceworker tool to make it easier to install different serviceworker implementations r=canaltinova
https://hg.mozilla.org/integration/autoland/rev/38e0508d04a1
[profiler] Small changes to the caching serviceworker profiler marker test r=canaltinova
https://hg.mozilla.org/integration/autoland/rev/9db79f22f4a2
[profiler] Report service worker install errors, so that tests don't timeout r=canaltinova
https://hg.mozilla.org/integration/autoland/rev/dde8a7d1b450
[profiler] Improve the reporting of objectContainsOnly in case of failures r=canaltinova
https://hg.mozilla.org/integration/autoland/rev/85e994430343
[profiler] In tests, make the network markers filter more generic r=canaltinova
https://hg.mozilla.org/integration/autoland/rev/33485f1d940b
[profiler] Change the test utility to find the service worker thread, using a profiler marker r=canaltinova
https://hg.mozilla.org/integration/autoland/rev/6cb63cc7c95d
[profiler, network] Change how we pass a few properties to the network markers r=valentin,necko-reviewers
https://hg.mozilla.org/integration/autoland/rev/21b8a519213b
[profiler] Add a test with a serviceworker that has no fetch handlers r=canaltinova
https://hg.mozilla.org/integration/autoland/rev/caf32cf2a12d
[profiler] Add redirect markers when respondWith isn't called in the service worker's fetch handler r=canaltinova,asuth,necko-reviewers
https://hg.mozilla.org/integration/autoland/rev/2ba472ddb892
[profiler] Add a test to check network markers for synthetized responses from a service worker r=canaltinova
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: