Repository navigation
Description
Problem
When a coordinator's drain times out, drain_pass (packages/rs-platform-wallet/src/manager/mod.rs) latches its QuiesceGate closed (latch_closed). This is deliberate, so a wedged pass cannot be followed by a fresh one. The latch clears only when a later drain succeeds (drain_succeeded).
start() does not touch the gate. It spawns the loop thread and the loop reports running, but every pass does nothing:
- each pass takes the
is_syncingslot, seesquiescing.is_closed()and returns an empty summary; - a manual
sync_now(true)bails the same way.
Nothing tells the host:
platform_wallet_manager_shielded_sync_startreturns OK;is_running()is true;- no completion event arrives, because a pass that bails returns before
on_shielded_sync_completed.
The loop stays dead after the wedged pass has finished. It recovers only when another drain succeeds (a later stop, clear or unregister) or the manager is rebuilt.
How it's reached
For shielded sync through the FFI:
platform_wallet_manager_shielded_sync_stoprunsquiesce(). A pass outlivesCOORDINATOR_DRAIN_BUDGET(10 s), so the stop returnsErrorShutdownIncomplete(27) and the gate stays latched.platform_wallet_manager_shielded_sync_starton the same manager starts the loop, and all its passes bail.
In Dash Wallet iOS this happens after Sync Info → Stop while a pass runs longer than 10 s, followed by Sync Now, or after any restart on the same manager. The app then shows shielded sync as running while nothing updates. Passes longer than the drain budget are common: #5200 lists four stops that returned code 27 in eight measured teardowns.
The platform-address, identity, DPNS and DashPay coordinators use the same QuiesceGate and drain_pass. Their passes bail on the same check, and their start() does not touch the gate either. Only the shielded path was traced end to end.
Direction
Keep the latch's guarantee that no fresh pass starts while the wedged one is still running. Then either:
start()clears the latch once the wedged pass has drained (is_syncingis false), and otherwise keeps the gate closed and reports it; orstart()returns an error while the gate is latched, so the host does not report a running loop.
Related
- platform-wallet: shielded sync stop and manager destroy wait for a whole in-flight pass #5200: why passes outlive the drain budget.
- fix(syncing): stop shielded sync off the main thread on every path dashwallet-ios#1171 lists this under "Not changed here", from review point 2.
🤖 Generated with Claude Code
Activity