Closed Bug 2076682 Opened 2 months ago Closed 1 month ago

Speculation-rules navigation intermittently doesn't use a completed prefetch

Categories

(Core :: Networking, defect, P3)

defect

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: smayya, Assigned: acreskey)

References

(Blocks 1 open bug)

Details

(Keywords: intermittent-failure, Whiteboard: [necko-triaged][fxpe])

Attachments

(1 external file)

While testing bug 2070841, several speculation-rules prefetch WPTs failed intermittently in a local macOS debug build (--headless, 11 runs each). Each time, the navigation went to the network instead of using the prefetched response, so the navigated page never saw the Sec-Purpose: prefetch header:

assert_in_array: Navigation didn't use the prefetched response! value undefined not in array ["prefetch", "prefetch;anonymous-client-ip"]

Failure rates:

  • no-vary-search/prefetch-single.https.html?21-21: 8/11
  • no-vary-search/prefetch-single.https.html?5-5: 2/11
  • no-vary-search/prefetch-single.https.html?8-8: 2/11
  • no-vary-search/prefetch-single.https.html?9-9: 1/11
  • no-vary-search/prefetch-single.https.html?12-12: 1/11
  • mutate-rules.https.html ("Removing a rule from the <script type=speculationrules> must not cancel the prefetch"): 1/11
  • tentative/service-worker/basic.sub.https.html?origin=same-site&sw=no-controller and ...&clientId: 1/11

In mutate-rules.https.html the server confirms the prefetch request arrived before the navigation, so the prefetch did start. The tests wait a fixed 2 seconds (forceSinglePrefetch) before navigating. When a test fails, the prefetch record is either not complete yet or not matched at navigation time.

These tests are marked expected: [PASS, FAIL] ([FAIL, PASS] for ?21-21) in the patches for bug 2070841.

https://tests.firefox.dev/test.html?test=/speculation-rules/prefetch/no-vary-search/prefetch-single.https.html
https://tests.firefox.dev/test.html?test=/speculation-rules/prefetch/mutate-rules.https.html

Blocks: 2076681
No longer blocks: 2037091
Severity: -- → S3
Priority: -- → P3
Whiteboard: [necko-triaged]
See Also: → 2076767
See Also: → 2077601

more tests show the same intermittent failure on try (https://treeherder.mozilla.org/jobs?repo=try&revision=1093c0984df537c0f8c48163e615f9ddb19e236b),
all ending in assert_prefetched … value undefined (the navigation was served from the network):

  • initiators-a-element.sub.https.html?same-site <a>
  • prefetch-status.https.html (200, 250, 299)
  • same-origin-cookies.https.html (?1-1, ?2-last)
  • referrer-policy.https.html?1-1, referrer-policy-from-rules.https.html?1-1, referrer-policy-not-accepted.https.html?1-1
  • user-pass.https.html?cross-origin=false
  • navigation-timing-delivery-type.https.html?prefetch=true&bypass_cache=false
  • navigation-timing-requestStart-responseStart.https.html?include=afterResponse
  • tentative/service-worker/basic.sub.https.html?origin=same-site&sw=no-fetch-handler (and &clientId)

One more from try (https://treeherder.mozilla.org/jobs?repo=try&revision=464c1e3e9d6c3f5dc7a1f1d04d979595e366df47): prefetch-single.https.html?from_protocol=https&to_protocol=https ("test single https url prefetch from a https url") failed on Android debug and Linux ASan with the same value undefined symptom. Marked [PASS, FAIL] with this bug.

One more from try (https://treeherder.mozilla.org/jobs?repo=try&revision=464c1e3e9d6c3f5dc7a1f1d04d979595e366df47): prefetch-single.https.html?from_protocol=https&to_protocol=https ("test single https url prefetch from a https url") failed on Android debug and Linux ASan with the same value undefined symptom. Marked [PASS, FAIL] with this bug.

Assignee: nobody → acreskey
Whiteboard: [necko-triaged] → [necko-triaged][fxpe]

Otherwise a no-store prefetched response can be purged before the navigation uses it.

No-store prefetches expire immediately and get purged once the memory cache fills; --setpref browser.cache.memory.capacity=256 reproduces it 10/10.

Attachment #9658845 - Attachment description: WIP: Bug 2076682 - Keep the prefetch's HTTP cache entry alive on the prefetch record. r?#necko-reviewers → Bug 2076682 - Keep the prefetch's HTTP cache entry alive on the prefetch record. r?#necko-reviewers
Attachment #9658845 - Attachment description: Bug 2076682 - Keep the prefetch's HTTP cache entry alive on the prefetch record. r?#necko-reviewers → Bug 2076682 - Keep the prefetch's HTTP cache entry alive on the prefetch record. r?#necko-reviewers,sunil
See Also: → 2082596
Pushed by acreskey@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/fe5a158d2580 https://hg.mozilla.org/integration/autoland/rev/3e2598a50f32 Keep the prefetch's HTTP cache entry alive on the prefetch record. r=necko-reviewers,sunil
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: