Repository navigation
fix(vault): announce reindex before waking the scan actor - #295
Merged
Merged
Conversation
A fast reindex can finish before the caller marks it as scanning, leaving the completed scan reported as running. Publish the start before queuing the work and cover the handoff with an empty-vault regression.
bketelsen
approved these changes
Nov 26, 2026
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
Announce
scanningbefore queuing a reindex so a fast scan cannot have its completedidlestatus overwritten. Add an empty-vault regression that checks the handoff without depending on scheduler timing.Fixes #282.
Risk tier
Risk tier: 2 — changes scan-status ordering only. Scan contents, index writes, and the RPC contract are unchanged.
Verification
make checkgreen (host) — blocked by NSGoTestCompletionsInSourceModeatediting_test.go:47. The timeout also reproduces undermake nsgo-checkwith the baseinternal/vault/vault.go.make vault-itgreen at the default iteration count — the full run was interrupted. The reducedFROSTNOTES_KILL_RUNS=4 make vault-itpassed all four crash modes.go test -race -count=1 ./internal/vaultfails with the fix reverted and the regression retained (TestReindexAnnouncesScanningBeforeWakingActor).make race-restpassed, as didgo test -race -count=2 -timeout=10m ./internal/vault ./internal/syncer.