fix(doctor): ignore vanished entries during acl tree verification - #213
Merged
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0f03fb67b6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
kyle-sexton
enabled auto-merge (squash)
August 11, 2026 23:53
verifyACLTree aborts the entire WalkDir when ACL.Verify returns ErrNotExist for a child listed moments earlier — a TOCTOU race against atomic temp-file + rename writes in state/jobs.json/observed.json. Skip fs.ErrNotExist for non-root paths during walk and after ACL probe so transient rename windows do not spuriously mark acl/* unhealthy, while real ACL faults and a missing root still fail the check. Fixes #114 Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
Only suppress ACL.Verify fs.ErrNotExist for non-root paths; the walk-error branch already excluded root, but the verifier branch did not, so a root removed after WalkDir lookup could spuriously mark acl/* healthy. Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
cursor
Bot
force-pushed
the
cursor/issue-114-doctor-acl-race-5554
branch
from
August 12, 2026 00:02
9bcc9bd to
3e6b4e2
Compare
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
verifyACLTreeaborted the entirefilepath.WalkDirwhenACL.Verifyreturnedfs.ErrNotExistfor a child that had been listed moments earlier — a TOCTOU race against atomic temp-file + rename writes instate(observed.json,jobs.json). That produced a spuriousacl/state(and occasionally otheracl/*)healthy:falsefor one poll.This change treats mid-enumeration vanish (
fs.ErrNotExiston a non-root path, either as a walk error or ACL probe error) as benign and continues the walk. Real ACL faults and a missing root still fail the check.Fixes #114
Test plan
TestVerifyACLTreeIgnoresVanishedChildDuringProbe— wrappedfs.ErrNotExistfrom ACL verifier on a listed child does not fail the walkTestVerifyACLTreeFailsOnRealACLFault— non-ErrNotExistACL faults still abortTestVerifyACLTreeFailsOnMissingRoot— missing root still failsTestVerifyACLTreeFailsWhenRootVanishesAfterWalkBegins— rootErrNotExistfrom ACL verifier after walk starts still failsTestLocalDoctorInspectorACLStateCheckFailsWhenRootVanishesDuringProbe— end-to-endacl/statestays unhealthy when root vanishes before probeTestVerifyACLTreeIgnoresVanishedChildDuringWalk— child removed between listing and probe stays healthyTestLocalDoctorInspectorACLStateCheckStaysHealthyWhenChildVanishesDuringProbe— end-to-endacl/statedoctor check stays healthy with unchanged entry countgo test -race ./internal/app/...Related
Fixes #114