fix: retry full synchronization after polling errors - #3509
Draft
sunchengzhu wants to merge 1 commit into
Draft
Conversation
sunchengzhu
force-pushed
the
scz/fix-sqlite-busy-sync-recovery
branch
from
September 1, 2026 12:40
b68bf3d to
e36483d
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, well-scoped, correctly retries failed polling iterations, and is backed by targeted regression tests with no issues found.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FullSynchronizer) alive when one polling iteration failsSQLITE_BUSYfailureFixes #3508.
Root cause
FullSynchronizer.initSync()previously wrapped the lifetime polling loop in a singletry/catch. Ifindexer.tip()or the wallet-cache work insynchronize()threw, including a transientSQLITE_BUSYfailure, control left the loop and the catch only logged the error. Becauseconnect()startsinitSync()in the background, the queue had already considered startup successful, so the existingindexer-errorrestart path was not reached.This change catches errors around one polling iteration. A failed iteration is logged, the synchronizer waits five seconds, and the next iteration can continue.
connect()remains non-blocking, so the queue can still install its block-tip and transaction subscriptions.Scope
This is a recovery fix for the permanently stopped polling loop. It does not remove the underlying SQLite contention, enable WAL, change
busy_timeout, serialize database writers, or implement bounded/exponential retry. Persistent failures are not escalated toindexer-erroror surfaced as an actionable UI error by this change. Those can be evaluated separately.This change only affects
FullSynchronizer. Transaction-status tracking andLightSynchronizerare unchanged, soSQLITE_BUSYwarnings or pop-ups may still occur. The fix specifically prevents a transient error in the full-node polling path from leaving wallet synchronization permanently stopped.Testing
yarn workspace neuron-wallet test --runTestsByPath tests/block-sync-renderer/full-synchronizer.test.ts tests/block-sync-renderer/queue.test.ts --coverage=false— 28 passedyarn workspace neuron-wallet test --coverage=false— 1,070 passed, 1 skippedyarn workspace neuron-wallet build