Closed Bug 1929190 Opened 1 year ago Closed 1 year ago

QM: Temporary origin is not initialized if a previous initialization attempt failed

Categories

(Core :: Storage: Quota Manager, defect, P1)

defect

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox133 --- fixed
firefox134 --- fixed

People

(Reporter: janv, Assigned: janv)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

https://searchfox.org/mozilla-central/rev/1bc0601cc5b3d4c3919d220acbe248221ebce035/dom/quota/ActorsParent.cpp#6085-6104

    QM_TRY_INSPECT(const bool& created, EnsureOriginDirectory(*directory));

    if (created) {
      const int64_t timestamp = PR_Now();

      FullOriginMetadata fullOriginMetadata =
          FullOriginMetadata{aOriginMetadata,
                             /* aPersisted */ false, timestamp};

      AddTemporaryOrigin(fullOriginMetadata);

      // Only creating .metadata-v2 to reduce IO.
      QM_TRY(MOZ_TO_RESULT(CreateDirectoryMetadata2(*directory, timestamp,
                                                    /* aPersisted */ false,
                                                    aOriginMetadata)));

      // Don't need to traverse the directory, since it's empty.
      InitQuotaForOrigin(fullOriginMetadata, ClientUsageArray(),
                         /* aUsageBytes */ 0);
    }

The case when the origin directory already exists (created by a previous failed initialization) needs to be handled.

Blocks: 1925418
Priority: P2 → P1
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e402a74f82c7 QM: Modify test_initializeTemporaryOrigin_failure.js to allow running multiple subtests; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/b7fdcfd96d84 QM: Add a disabled subtest for a failure during temporary origin initialization; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/6c85fec070ed QM: Initialize temporary origin even if a previous initialization attempt failed; r=dom-storage-reviewers,asuth
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
Crash Signature: [@ mozilla::dom::quota::OriginInfo::LockedAccessTime ]

Comment on attachment 9436859 [details]
Bug 1929190 - QM: Initialize temporary origin even if a previous initialization attempt failed; r=#dom-storage

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: Theses patches are meant to fix a top crash
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: Bug 1927723 and bug 1928092 (patches for all 3 bugs D227198 - D228670 need to land together, 10 patches in total)
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): I think the risk is rather low despite the number of patches. Most of them are just about providing new testing infrastructure and new tests.
  • String changes made/needed: None
  • Is Android affected?: Yes
Attachment #9436859 - Flags: approval-mozilla-beta?

Comment on attachment 9436859 [details]
Bug 1929190 - QM: Initialize temporary origin even if a previous initialization attempt failed; r=#dom-storage

Approved for 133.0b9

Attachment #9436859 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Crash Signature: [@ mozilla::dom::quota::OriginInfo::LockedAccessTime ]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: