Closed Bug 1709352 Opened 3 years ago Closed 3 years ago

QM: Add support for error stacks

Categories

(Core :: Storage: Quota Manager, task, P2)

task

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: janv, Assigned: janv)

References

(Blocks 1 open bug)

Details

Attachments

(14 files, 1 obsolete file)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Jens suggested that we could get precise error stacks if we had a wrapper around nsresult that would hold info about error propagation. I think I figured out how to do that.

See Also: → 1703844
Blocks: 1703844
See Also: 1703844

Depends on D114245

See Also: → 1709777

Did you analyze the effect of QMResult on code generation?
I am not sure in how many cases we benefit from the unused-zero optimization of Result<V, nsresult> now.

I fear this will make it even more relevant to restrict the builds this gets into.

Maybe QMResult should better be called QMError if it's never used to indicate success.

(In reply to Simon Giesecke [:sg] [he/him] from comment #9)

Did you analyze the effect of QMResult on code generation?

Not yet, but maybe it's not that urgent if we add some ifdef, see below.

I fear this will make it even more relevant to restrict the builds this gets into.

That's actually a good observation, we can put all extra member variables in QMResult behind the ifdef that we already have for stuff like this.

Maybe QMResult should better be called QMError if it's never used to indicate success.

Originally I wanted to have the ability to use it without mozilla::Result, but maybe it's not needed and then we would rename it to QMError.

This makes it consistent with other places where we check EARLY_BETA_OR_EARLIER
and DEBUG identifier. For example HandleError.

Depends on D114340

The appening of module extra key was already commented out.

Ok, so I was able to limit the overhead to EARLY_BETA_OR_EARLIER || DEBUG builds.
sizeof(Result<Ok, nsresult) and sizeof(Result<Ok, QMResult) is the same in Release builds (the size is 4 bytes).

sizeof(Result<Ok, QMResult) in Nightly builds is 24 bytes.

(In reply to Jan Varga [:janv] from comment #14)

Ok, so I was able to limit the overhead to EARLY_BETA_OR_EARLIER || DEBUG builds.
sizeof(Result<Ok, nsresult) and sizeof(Result<Ok, QMResult) is the same in Release builds (the size is 4 bytes).

sizeof(Result<Ok, QMResult) in Nightly builds is 24 bytes.

For the sake of readability I was just wondering if we should have some specifically labeled switch (#define) instead of sparse #if defined(EARLY_BETA_OR_EARLIER) || defined(DEBUG) throughout the code?

The new code for error stacks already has it, QM_ERROR_STACKS_ENABLED.

I was referring to the ones introduced in Bug 1709352 - Define LogError only when needed; r=#dom-storage, are those the same scope?

That can be changed too.

Attachment #9220128 - Attachment is obsolete: true
Attachment #9220127 - Attachment description: Bug 1709352 - Add special constructor for GenericErrorResult created from Result::propagateErr; r=#dom-storage → Bug 1709352 - Allow QMResult errors to use existing stack id and to increase the frame id during error propagation; r=#dom-storage
Keywords: leave-open
Pushed by jvarga@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5ed477dfcd93
Introduce QMResult; r=dom-storage-reviewers,jstutte
https://hg.mozilla.org/integration/autoland/rev/922a380b0d86
Add ToResult function for QMResult; r=dom-storage-reviewers,jstutte,asuth
https://hg.mozilla.org/integration/autoland/rev/b4c891b1a31e
Allow QMResult errors to use existing stack id and to increase the frame id during error propagation; r=dom-storage-reviewers,asuth,glandium
https://hg.mozilla.org/integration/autoland/rev/8313509e7cc1
Convert MaybeRemoveLocalStorageArchiveTmpFile to return Result<Ok, QMResult>; r=dom-storage-reviewers,asuth
Pushed by jvarga@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e538b40f3e43
Add logging support for QMResult; r=dom-storage-reviewers,jstutte
https://hg.mozilla.org/integration/autoland/rev/038434c75607
Reorder appending of extra keys to match the definition in Events.yaml; r=dom-storage-reviewers,jstutte
https://hg.mozilla.org/integration/autoland/rev/6d45855c91a7
Add frame_id, process_id and stack_id to QM_TRY telemetry; r=dom-storage-reviewers,jstutte
https://hg.mozilla.org/integration/autoland/rev/f1905864fccd
Define LogError only when needed; r=dom-storage-reviewers,jstutte
https://hg.mozilla.org/integration/autoland/rev/bdfc8a9626c1
Support error stacks only in EARLY_BETA_OR_EARLIER) || DEBUG builds; r=dom-storage-reviewers,jstutte
https://hg.mozilla.org/integration/autoland/rev/d239739c9637
Remove the module extra key from LogError; r=dom-storage-reviewers,jstutte
Pushed by jvarga@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fa9b64cfbfc9
Follow-up patch to fix indentation; r=dom-storage-reviewers,jstutte
Regressions: 1712811

LogError signature is now separately defined for the case when
QM_ERROR_STACKS_ENABLED is defined and when it's not defined). HandleError has
been changed as well to have explicit handling depending on
QM_ERROR_STACKS_ENABLED.

Pushed by jvarga@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f65bf0f5a4d8
Fix compilation when QM_ERROR_STACKS_ENABLED is not defined; r=dom-storage-reviewers,asuth

Depends on D116121

Keywords: leave-open
Pushed by jvarga@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/13f9d77af67b
Add missing mozilla/Variant.h include to QuotaCommon.h; r=dom-storage-reviewers,jstutte
https://hg.mozilla.org/integration/autoland/rev/0caad459ce02
Clean up and polish LogError; r=dom-storage-reviewers,jstutte
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: