Repository navigation
gitindex: abort indexing after blob input errors - #1250
Merged
keegancsmith merged 2 commits intoNov 16, 2026
Merged
Conversation
Signed-off-by: Tomás Senart <[email protected]>
Signed-off-by: Tomás Senart <[email protected]>
keegancsmith
approved these changes
Nov 16, 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.
If
git cat-filefails duringzoekt-git-index, the deferredFinishcan publish a partial or empty shard over the complete index. The command reports an error, but files—or the entire repository—then silently drop out of search.This is the input-time sibling of merged #1227, which handles failures during shard publication. This change prevents failed blob ingestion from reaching publication in the first place, for both full and delta indexing.
Add
Builder.Abortto discard buffered documents, wait for shard workers, and remove staged files without publishing them or retiring the prior index. Git indexing defersAbortand callsFinishexplicitly after ingestion succeeds. Stored worker-error cleanup reuses the same path. Successful indexing and intentionally missing or size-filtered blobs keep their existing finalization behavior.Go tests for
indexandgitindexpassed, covering input-failure preservation and retry, abort lifecycle, worker errors, successful indexing, and publication failures. The tests ingitindex/index_test.gocheck unchanged index artifacts and old search results after reader-startup, header, body, and go-git blob errors, with buffered and staged prefixes;index/builder_test.gochecks abort idempotency and terminal state. Repository protobuf lint passed.Failure frequency and affected repository sizes remain unmeasured. Temporary-file cleanup is best-effort; publication remains non-atomic.
Case and evidence
Made by Perfloop. Human sponsor: Tomás Senart.