Skip to content

fix(vault): announce reindex before waking the scan actor - #295

Merged
bketelsen merged 1 commit into
mainfrom
irulan/frostnotes-282-scan-timeout
Nov 26, 2026
Merged

bketelsen merged 1 commit into
mainfrom
irulan/frostnotes-282-scan-timeout

Conversation

@frostyard-machines

Copy link
Copy Markdown
Contributor

Summary

Announce scanning before queuing a reindex so a fast scan cannot have its completed idle status 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 check green (host) — blocked by NSGo TestCompletionsInSourceMode at editing_test.go:47. The timeout also reproduces under make nsgo-check with the base internal/vault/vault.go.
  • make vault-it green at the default iteration count — the full run was interrupted. The reduced FROSTNOTES_KILL_RUNS=4 make vault-it passed all four crash modes.
  • Revert test: go test -race -count=1 ./internal/vault fails with the fix reverted and the regression retained (TestReindexAnnouncesScanningBeforeWakingActor).
  • make race-rest passed, as did go test -race -count=2 -timeout=10m ./internal/vault ./internal/syncer.

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.
@github-actions github-actions Bot added the level:L3 Skim label Nov 26, 2026
@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 26, 2026
@bketelsen
bketelsen merged commit 8d299f8 into main Nov 26, 2026
16 checks passed
@bketelsen
bketelsen deleted the irulan/frostnotes-282-scan-timeout branch November 26, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:L3 Skim ready-for-human Reviewed, CI green: ready for Brian to review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

internal/syncer: TestACrashWhileDeletingTheLastFileLetsTheDeviceSyncOn timed out waiting for a scan in the race shard

2 participants