fix(auth): retry ExecProvider spawn on transient ETXTBSY - #84
Merged
Conversation
Linux can report ETXTBSY for a just-written, freshly chmod'd provider script when another thread in the process forks at the same moment, even though nothing holds the file open for writing. This surfaced as an intermittent panic in exec_provider_sends_request_to_stdin_and_parses_credential under concurrent test execution, and is a real risk for any consumer spawning provider scripts under load. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Improves reliability of the ExecProvider auth provider by making process startup resilient to transient ETXTBSY (“Text file busy”) errors seen in CI and under concurrent exec load.
Changes:
- Wraps
ExecProvider::exec_raw’sCommand::spawn()call with a retry loop specifically forErrorKind::ExecutableFileBusy. - Adds an internal async helper (
spawn_retrying_text_busy) implementing exponential backoff before retrying spawn.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The prior loop spawned 5 times but only slept 4 times (1/2/4/8ms), so the computed 16ms delay was never used, contradicting the documented backoff. Restructure as 5 retries (6 attempts total) so the 16ms delay is actually slept before the final attempt. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
qcai-godaddy
approved these changes
Aug 4, 2026
Merged
jpage-godaddy
pushed a commit
that referenced
this pull request
Aug 5, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>cli-engine: 0.8.1</summary> ## [0.8.1](cli-engine-v0.8.0...cli-engine-v0.8.1) (2026-08-05) ### Bug Fixes * **auth:** retry ExecProvider spawn on transient ETXTBSY ([#84](#84)) ([b2be4f3](b2be4f3)) * **output:** prefix pagination next_actions with the binary name ([#86](#86)) ([f65ae91](f65ae91)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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.
Summary
exec_provider_sends_request_to_stdin_and_parses_credential:Text file busy (os error 26)when exec'ing a freshly written, freshly chmod'd provider script.ETXTBSYcan be transiently reported when one thread execs a file while another thread in the same process forks at the same moment, even though nothing holds the file open for writing. Go'sos/exechas retried on this since Go 1.9.ExecProvider::exec_rawhad no retry aroundspawn(), so this is a real risk for any consumer that writes and execs a provider script under concurrent load, not just test flakiness.ExecProvider::spawn_retrying_text_busy, which retriesCommand::spawn()up to 5 additional times (6 attempts total) with exponential backoff (1ms → 16ms between attempts) specifically onErrorKind::ExecutableFileBusy, surfacing any other spawn error immediately.Failing run: https://github.com/godaddy/cli-engine/actions/runs/30959476281/job/92160057511?pr=83
Test plan
cargo fmt --all --checkcargo clippy --all-targets -- -D warningsRUSTDOCFLAGS='-D warnings' cargo doc --no-depscargo test --all-targets(all 282 tests infoundation.rsplus all other suites pass)cargo test --docexec_provider_*suite multiple times to confirm stability🤖 Generated with Claude Code