Shift-reload should only clear Alt-Svc mappings matching the channel's origin attributes
Categories
(Core :: Networking: HTTP, defect, P2)
Tracking
()
| 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:
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.
Worth monitoring, once landed in Firefox, is the following metric:
| Assignee | ||
Comment 2•1 month ago
|
||
Comment 4•1 month ago
|
||
| bugherder | ||
Updated•21 days ago
|
Description
•