Closed Bug 2080863 Opened 1 month ago Closed 1 month ago

Shift-reload should only clear Alt-Svc mappings matching the channel's origin attributes

Categories

(Core :: Networking: HTTP, defect, P2)

defect

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: mail, Assigned: afucks)

References

Details

(Whiteboard: [necko-triaged])

Attachments

(1 external file)

On a shift-reload of a top-level document (LOAD_FRESH_CONNECTION | LOAD_INITIAL_DOCUMENT_URI), nsHttpChannel::BeginConnect wipes the entire Alt-Svc cache:

https://searchfox.org/firefox-main/rev/8e9ac3e12bbaf39d4c282dc8849221aa17d4f714/netwerk/protocol/http/nsHttpChannel.cpp#8453

gHttpHandler->AltServiceCache()->ClearAltServiceMappings();

AltSvcCache::ClearAltServiceMappings (netwerk/protocol/http/AlternateServices.cpp) calls mStorage->Clear(), dropping every mapping for every origin attributes: other containers, other partitions, private browsing. A shift-reload in one container thus throws away the HTTP/3 and HTTP/2 alternates learned in all others.

Bug 2078543 (https://phabricator.services.mozilla.com/D331099) scopes the connection cleanup next to it, DoShiftReloadConnectionCleanupWithConnInfo, to the channel's origin attributes. The Alt-Svc cache should get the same treatment.

The OA suffix is already part of each key (AltSvcMapping::MakeHashKey appends originAttributes.CreateSuffix()), so one option: add an AltSvcCache::ClearAltServiceMappings(const OriginAttributes&) that walks mStorage->GetAll() and removes the entries whose key carries the matching suffix, and call it with mConnectionInfo->GetOriginAttributes(). Then extend test_freshconnection_origin_attributes.js (or add a sibling test) to check that a fresh load under one userContextId / partitionKey keeps the Alt-Svc mappings of another.

Assignee: nobody → afucks
Status: NEW → ASSIGNED
See Also: → 2060496
Pushed by valentin.gosu@gmail.com: https://github.com/mozilla-firefox/firefox/commit/dce017a437f3 https://hg.mozilla.org/integration/autoland/rev/f233e8c1902b Shift-reload should only clear Alt-Svc mappings matching the channel's origin attributes r=necko-reviewers,valentin
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
QA Whiteboard: [qa-triage-done-c161/b160]
See Also: → 2087972
See Also: → 2087973
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: