fix: treat missing git objects as a benign teardown race in the daemon - #64
Draft
posthog[bot] wants to merge 1 commit into
Draft
posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
Widen is_missing_working_dir_error to match the missing-object exit-128
stderr strings ("not a tree object", "bad object", "unknown revision").
A snapshot side effect passes a tree oid to `ls-tree` in
committed_file_snapshot_between_commits. When a temp repo is torn down
mid-operation its directory can survive while its objects are gone, so
git answers "fatal: not a tree object". The old classifier matched only
"No such file or directory" and "not a git repository", so this shape
slipped past the guard, hit tracing::error!, and SentryLayer turned it
into a fresh error-tracking issue for a benign race. The side effect is
skipped either way, so the daemon now skips it quietly at debug level.
Generated-By: PostHog Desktop
Task-Id: c4d492f8-b2ae-45e7-ba2b-52ef0fe09bdd
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.
Problem
committed_file_snapshot_between_commitsrunsls-tree -r -z --name-only <tree oid>.Commit::treetrusts the loose-object fast reader and checks only the oid's shape, never its existence, so a vanished object reaches git as a normal argument.fatal: not a tree object(exit 128).is_missing_working_dir_errormatched onlyNo such file or directoryandnot a git repository, so this shape slipped past it, hittracing::error!, andSentryLayerturned the ERROR into an exception.Changes
is_missing_working_dir_errorinsrc/daemon.rsto also treat the missing-object exit-128 stderr strings as the same benign race, so the side effect skips quietly at debug level:stderr.contains("No such file or directory") || stderr.contains("not a git repository") + || stderr.contains("not a tree object") + || stderr.contains("bad object") + || stderr.contains("unknown revision")not a valid object namematches none of the new substrings).Expected impact
Testing
Created with PostHog Desktop from this inbox report.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.