mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #269] [MERGED] fix(image): avoid ETXTBSY in fake regctl setup #304
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#304
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/269
Author: @yingdi-shan
Created: 9/9/2026
Status: ✅ Merged
Merged: 9/10/2026
Merged by: @yingdi-shan
Base:
main← Head:fix/resolver-fake-regctl-etxtbsy📝 Commits (1)
75dfcd9fix(image): avoid ETXTBSY in fake regctl setup📊 Changes
1 file changed (+16 additions, -21 deletions)
View changed files
📝
src/image/resolver.rs(+16 -21)📄 Description
What
Fix intermittent
Text file busy (os error 26)failures in the resolver's fakeregctlsetup. Create the executable in a child shell and wait for successful completion before returning its path.Why
discover_overlaybd_referrer_lists_referrers_unfiltered_and_finds_acr_streamingcan fail when another test forks while the helper has the script open for writing. The child inherits that descriptor until exec or exit, so closing the parent's handle, syncing, and renaming the file still leaves a window forETXTBSY.Related issue
N/A — small fix for the reported intermittent unit-test failure.
Scope and non-goals
Only the
fake_regctlhelper insrc/image/resolver.rschanges. Production image resolution and registry behavior are unchanged.Design and behavior changes
The child shell owns the executable's writable descriptor, so sibling test processes cannot inherit it. The helper checks that installation succeeded before launching the fake command. The path and script are passed as quoted positional arguments; fixture lookup remains relative to
$0, preserving support for temporary paths containing shell metacharacters.Compatibility and operations
Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetCommands and results:
Tests used isolated temporary AENV state and dependency paths. A temporary standalone Rust harness exercised the actual helper with four concurrent fixture workers and four concurrent process-spawn workers, holding inherited descriptors for 10 ms before exec. The original helper failed 88 of 400 launches with
ETXTBSY; the replacement completed 4,000 launches with zero failures. Successful launches verified argv, stdout, stderr, and both success/failure exit codes, including paths containing spaces, quotes, dollar signs, and backticks. This harness was a local validation tool and is not part of the patch.Skipped checks and reasons: the focused library tests cover this helper; the aggregate capability/VM suites, Go tests, code generation, documentation, and benchmarks do not apply to this test-only change.
Risks and reviewer notes
Adds a short-lived shell process to each of the two discovery tests. Existing assertions continue to verify the unfiltered registry command and error propagation. Review the descriptor ownership comment and the positional-argument quoting in
fake_regctl.Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.