Open
Description
Summary
Investigate and bound the replay lifetime when the filter-stall watchdog reaches EXHAUSTED in the SDK sync flow.
This finding was raised in #1584. @HashEngineering reported that the affected code is now identical to the base branch after merging feat/kotlin-sdk-phase-1 at 647624cff, and that the code previously landed through #1568. Triage and fix this separately against feat/kotlin-sdk-phase-1, not as part of the contested-username fee changes.
Reported behavior and risk
The review found that:
replayActiveremains true whileblockPipelineLaggingis true.- The blockchain service skips idle shutdown while replaying and acquires the replay wake lock without a timeout.
- The wake lock is released when replaying becomes false or during service destruction.
- The watchdog's
EXHAUSTEDbranch only logs, leaving no bounded terminal recovery path.
If confirmed on the target branch, a parked block pipeline can keep the service and replay wake lock active indefinitely.
Required changes
- Verify the watchdog, replay-state, and wake-lock lifecycle on the target branch.
- Propagate terminal watchdog exhaustion to the service as an explicit failure or bounded recovery outcome, or implement another bounded recovery path.
- Release the replay wake lock and allow normal idle shutdown when recovery is exhausted.
- Preserve accurate incomplete-scan state. Do not mark unfinished replay as successfully completed merely to release the wake lock.
- Preserve safe retry and restart behavior for interrupted replay.
Affected areas
wallet/src/de/schildbach/wallet/service/platform/sdk/L1ShadowSyncService.kt: watchdog exhaustion handling and replay lifecycle.wallet/src/de/schildbach/wallet/service/platform/sdk/SdkBlockchainStateMapper.kt: propagation of replay lifecycle state.wallet/src/de/schildbach/wallet/service/BlockchainServiceImpl.kt: replay wake-lock ownership and idle shutdown.FilterStallWatchdogDecider: terminal watchdog decision.
Acceptance criteria
- A test covers watchdog exhaustion while the block pipeline still lags.
- Exhaustion cannot leave the replay wake lock held indefinitely.
- The service can resume normal idle shutdown after terminal recovery.
- Unfinished scan work is not reported as successful replay completion.
- Tests cover normal replay completion and retry/restart behavior after exhaustion.
References
Metadata
Metadata
Assignees
Labels
No labels
Activity