Repository navigation
Conversation
Durability::claim dropped its locked File without an explicit unlock on binding and metadata rejection paths. A child forked concurrently (before exec closes CLOEXEC descriptors) shares the open file description, so the flock survived the failed claim and the next claim saw a spurious Owned. Wrap the lock in an OwnerLock guard that unlocks on every drop path. run_dispatches_acp_with_exact_cwd_hooks_and_no_openhands polled for run.json status `succeeded`, which the continuation retry rewrites to `preparation_failed` + pending_retry within milliseconds because the mock issue stays active. Accept a pending continuation retry on a manifest that recorded a successful after_run hook as equivalent normal-exit evidence. Co-Authored-By: Claude <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Owner
Author
|
Superseded by #258 (same commit, head branch |
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
Two
rustCI tests failed intermittently on unrelated PRs (e.g. #253). Both come from races; neither was a slow runner hitting a timeout.1.
opensymphony_acp::durable::tests::reuse_checks_profile_scope_workspace_repository_and_checkout_binding(real product bug)Durability::claimtakes an exclusiveflockonacp-owner.lockand then validates bindings. When a check fails (Binding("profile"),Binding("profile fingerprint"),InvalidMetadata, …), the lockedFilewas simply dropped. OnlyDurability::dropcalledunlock(), and the claim had failed before aDurabilityexisted.A flock belongs to the open file description. If another thread forks a child at that moment (the lib test binary runs about 1,480 tests in parallel, and many spawn processes), the child inherits the descriptor until
execcloses it. A plain close in the parent then leaves the lock held, so the next claim'stry_lockgetsWouldBlockand returnsDurabilityError::Ownedinstead of the expectedBinding(..). That is exactly what CI showed: the "credential scope" iteration failed right after twoBindingrejections (run 42456882698, lib binary at 118s under load). In production, a rejected claim could also briefly make a legitimate concurrent claim see a spuriousOwned.Fix: wrap the lock in an
OwnerLockguard right aftertry_locksucceeds. The guard unlocks explicitly on every drop path, andDurabilityholds the guard in place of its ownDropimpl.2.
run::run_dispatches_acp_with_exact_cwd_hooks_and_no_openhands(test race)The mock Linear issue stays active. After each successful ACP run the scheduler queues a continuation retry, and
persist_retry_pendingrewrites run.json tostatus: preparation_failedwithpending_retry: trueandretry_reason: continuation. The test polled every 25 ms forstatus == "succeeded", a state that lasts only a few milliseconds. In the failing CI run (42457696381, attempt 1) theafter_runhook finished at07:40:31.643and run.json was overwritten at.648. The test missed every window for 17 attempts and timed out with run.json at attempt 17.Fix: the test now accepts either
succeededor a pendingcontinuationretry with noretry_error, as long as that same manifest recorded a successfulafter_runhook. Continuation retries are queued only after a normal worker exit; failures usefailure/stalled, so the check is still strict. The timeout is unchanged.Evidence
fcntl.flock+os.forkexperiment with the same kernel semantics. The lock is held, a child is forked and sleeps before exiting, the parent closes the fd, then the lock file is reopened and locked:next claim WouldBlock -> DurabilityError::OwnedLOCK_UNbefore close:next claim acquired lockopensymphony_acp::lib suite (53 tests,--test-threads 64) and the durable test concurrently.cargo fmt --all --check: cleancargo clippy-dev(--all-targets -D warnings): clean