Repository navigation
Conversation
A test that wrote a stand-in program with std::fs::write and ran it could fail with ETXTBSY: another thread's fork, between fork and exec, held a copy of the write descriptor (hosted CI, levi::tests::output_held_open_after_levi_ exits_doesnt_outlast_the_deadline on PR #275). rally::script::write writes the script through a child (sh, cat, chmod 755), so the test process never holds it open for writing; all 14 write-then-chmod sites use it, with a test that writes and runs a script 200 times beside four forking threads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Hosted CI on PR #275 failed once in
levi::tests::output_held_open_after_levi_exits_doesnt_outlast_the_deadlinewith "Text file busy (os error 26)" running its fake levi. Cause: the test wrote the script withstd::fs::writeand ran it, while another test thread forked; between its fork and exec the child held a copy of the write descriptor (close-on-exec narrows the window but can't shut it), and exec of a file open for writing is refused.src/script.rs:rally::script::write(path, text)writes through a child (sh -c 'cat > "$1" && chmod 755 "$1"', text on stdin), so the test process never holds the file open at all.true, never busy. A standalone reproduction on Murph:std::fs::write+ chmod failed 6 and 7 of 300; through a child, 0 and 0.🤖 Generated with Claude Code