Repository navigation
fix(upgrade): retry ETXTBSY when verifying the freshly copied binary - #1338
Merged
Merged
Conversation
Executing a just-written binary can fail with 'Text file busy' if another thread/process forks while the write descriptor is still open. Retry the --version check briefly; fixes the flaky replace_binary_verifies_and_installs test and the same race in real upgrades. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Oct 8, 2026
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.
What
uteke upgradeverifies a freshly copied binary by running<bin> --version. That spawn now goes throughrun_version_check, which retries (up to 8 times, 25 ms × attempt backoff) while the OS reportsETXTBSY("Text file busy", os error 26).Why
Executing a binary right after writing it fails with
ETXTBSYwhen another thread/process forks while the write descriptor is still open (the child briefly inherits it). It makescommands::upgrade::tests::replace_binary_verifies_and_installsflaky in CI (failed twice in a row on #1333 while passing on other PRs and on develop), and the same race exists in real upgrades.Testing
cargo clippy -p uteke-cli --all-targetsclean.cargo test -p uteke-cli replace_binarypasses 5/5 runs locally.🤖 Generated with Claude Code