Closed Bug 1704432 Opened 4 years ago Closed 1 year ago

[QM_TRY] Failures in dom/quota/ActorsParent.cpp:LoadLocalStorageArchiveVersion

Categories

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

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jstutte, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Clients Sessions Hits Anchor Stack
2 2 2 dom/quota/ActorsParent.cpp:LoadLocalStorageArchiveVersion dom/quota/ActorsParent.cpp#667:None <- dom/quota/ActorsParent.cpp#5875:NS_ERROR_FILE_CORRUPTED

From what I read in the code I would have expected to see some NS_ERROR_* result already here coming from the previous call?

  QM_TRY_INSPECT(const auto& stmt,
                 CreateAndExecuteSingleStepStatement<
                     SingleStepResult::ReturnNullIfNoResult>(
                     aConnection, "SELECT version FROM database"_ns));

  QM_TRY(OkIf(stmt), Err(NS_ERROR_FILE_CORRUPTED));   <---------- We fail here but without error?
Flags: needinfo?(jvarga)

Jens, OkIf function returns Result<Ok, NotOk>. Ok and NotOk are just empty structs. There's no error code. The None string may be confusing, it's not that there's no error.

Flags: needinfo?(jvarga)

IIUC, the OkIf condition is the underlying error here, that is stmt == nullptr. So actually we have an arbitrary error during QM_TRY_INSPECT that makes stmt to be returned as nullptr (due to SingleStepResult::ReturnNullIfNoResult), which we then intercept and interpret as NS_ERROR_FILE_CORRUPTED, ignoring what really happened to our SELECT statement.

Severity: -- → S3
Depends on: 1590640
Priority: -- → P3
See Also: → 1705383

Hi Jan, this seems to have ceased since two months now. Did we do something to the reporting here?

Flags: needinfo?(jvarga)

(In reply to Jens Stutte [:jstutte] from comment #4)

Hi Jan, this seems to have ceased since two months now. Did we do something to the reporting here?

This probably disappeared because we converted ordinary orElse to QM_WARN_OR_ELSE. The corruption is handled by creating an empty archive, but before the special macro, the corruption was reported as an error. It's now moved to warnings in QM_TRY reports because QM_WARN_OR_ELSE adds a special warning event to the telemetry.

See:
https://hg.mozilla.org/releases/mozilla-beta/annotate/e4ba3bcb9d881637a2c30daf7fa9f544087ba181/dom/quota/ActorsParent.cpp#l6034 https://hg.mozilla.org/mozilla-central/file/bb08fc2c750e013498236a40c2f8eed5c99538d5/dom/quota/ActorsParent.cpp#l6019

Flags: needinfo?(jvarga)
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.