Skip to content

fix(platform-wallet): keep a stop from waiting on a background shielded sync restart #6448

Backlog

Description

@lklimek

TL;DR: A request to stop background shielded sync can be delayed while a restart that is already in progress finishes reaping the previous worker.

User story

As a wallet app developer, I want stopping shielded sync to start its own time budget immediately, so app shutdown and account switches stay fast.

Scenario

Base flow

A rebuild or an explicit start restarts background shielded sync while the previous worker is still being reaped. At the same time the app asks to stop sync.

Actual behavior

The restart holds the sync-intent lock for the whole start, including the bounded reap of the old worker. Stop and quiesce take the same lock before their drain timer starts, so they wait for the reap first.

Expected behavior

Stop records its intent without waiting for an in-progress start, and still wins over it.

Detailed discussion

Proposed approach: shorten the critical section of the restart while keeping stop ordering (a stop issued during a start must still prevent the started worker from running). A simple two-check atomic scheme is not enough, because work could begin between the checks.

Prior work

🤖 Co-authored by Claudius the Magnificent AI Agent

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions