Open Bug 1879361 Opened 9 months ago Updated 9 months ago

Record why a bookmark merge was interrupted

Categories

(Firefox :: Sync, task, P3)

task

Tracking

()

ASSIGNED

People

(Reporter: lina, Assigned: lina)

Details

Attachments

(1 file)

When a bookmark merge is interrupted—either because of an Async.Watchdog firing for a long-running merge, the bookmarks engine being disabled, or shutdown—the mirror checks the abort signal, and throws an InterruptedError. InterruptedError doesn't report the cause, so we know what operation was interrupted, but not why.

It looks like AbortSignal and Error have new ways to bubble up the cause now, so let's take advantage of them. I think this will give us more visibility in telemetry about how frequently merges are interrupted, and why.

This change takes advantage of two new language features:

  • AbortController::abort() now takes an optional reason, and exposes
    that reason via AbortSignal::reason (bug 1737771).
  • The Error constructor now takes a new cause option, which it
    sets on the error (bug 1679653).

SyncedBookmarksMirror now aborts in-progress merges at shutdown with
a FinalizedError, and Async.Watchdog aborts with either a
TimeoutError or a ShutdownError. The mirror propagates these errors
as the cause of all InterruptedErrors.

SyncTelemetry.transformError unwraps these causes, so that we can
record why a merge was interrupted, not just the specific operation
that was interrupted.

These error causes are "unwrapped" in the , so we
can see why a merge was interrupted.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: