Skip to content

Conversation

@iamkroot
Copy link
Contributor

@iamkroot iamkroot commented Nov 30, 2025

Seeing some weird errors in CI, this seems like a good fix


Note

Adds Unix ETXTBUSY-aware retry with exponential backoff for shebang script execution and uses async file writes when creating temp scripts.

  • Task execution:
    • Retry executing temp shebang scripts on Unix when ETXTBUSY occurs, with exponential backoff (up to 3 attempts) via exec_with_text_file_busy_retry.
    • Introduce is_text_file_busy (Unix-only) to detect ETXTBUSY using nix::errno::Errno and eyre::Report error chaining; no-op on non-Unix.
    • Switch temp script creation to tokio::fs::write and call retry path from exec_script.
  • Imports:
    • Include eyre::Report and (Unix) nix::errno::Errno.

Written by Cursor Bugbot for commit 8c0603d. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings November 30, 2025 19:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds retry logic for handling ETXTBUSY errors when executing shebang scripts in CI environments. The change addresses race conditions that can occur when a script file is written and immediately executed.

Key changes:

  • Replaced synchronous file writing with async tokio::fs::write for shebang scripts
  • Added retry mechanism with exponential backoff for ETXTBUSY errors
  • Introduced helper function to detect text file busy errors by checking OS error code

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jdx
Copy link
Owner

jdx commented Dec 1, 2025

bugbot run

@jdx
Copy link
Owner

jdx commented Dec 2, 2025

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no bugs!


@jdx jdx merged commit 9b391f2 into jdx:main Dec 2, 2025
28 checks passed
@iamkroot iamkroot deleted the fix-txtbusy branch December 2, 2025 03:47
jdx pushed a commit that referenced this pull request Dec 4, 2025
### 🚀 Features

- **(config)** add support for netrc by @RobotSupervisor in
[#7164](#7164)
- **(lock)** add resolve_lock_info to core backends for checksum
fetching by @jdx in [#7180](#7180)
- **(ruby)** Install ruby from a zip file over HTTPS by @KaanYT in
[#7167](#7167)
- **(tasks)** add `usage` args to Tera context in run scripts by
@iamkroot in [#7041](#7041)

### 🐛 Bug Fixes

- **(lock)** validate platform qualifiers when reading from lockfile by
@jdx in [#7181](#7181)
- **(task)** retry shebang scripts on ETXTBUSY by @iamkroot in
[#7162](#7162)
- **(ui)** remove duplicate 'mise' prefix in verbose footer output by
@jdx in [#7174](#7174)

### 📦️ Dependency Updates

- bump usage-lib to 2.9.0 by @jdx in
[#7177](#7177)

### 📦 Registry

- remove duplicated ubi and github backends from gping by @risu729 in
[#7144](#7144)
- disable bashly test (not working in CI) by @jdx in
[#7173](#7173)
- disable cfn-lint test (failing in CI) by @jdx in
[#7176](#7176)

### Chore

- add fd to mise.toml by @blampe in
[#7178](#7178)

### New Contributors

- @RobotSupervisor made their first contribution in
[#7164](#7164)

## 📦 Aqua Registry Updates

#### New Packages (2)

- [`Kitware/CMake`](https://github.com/Kitware/CMake)
- [`quarto-dev/quarto-cli`](https://github.com/quarto-dev/quarto-cli)

#### Updated Packages (6)

- [`apache/jena`](https://github.com/apache/jena)
- [`apache/spark`](https://github.com/apache/spark)
-
[`danielfoehrKn/kubeswitch`](https://github.com/danielfoehrKn/kubeswitch)
-
[`danielfoehrKn/kubeswitch/switch-sh`](https://github.com/danielfoehrKn/kubeswitch/switch-sh)
- [`evilmartians/lefthook`](https://github.com/evilmartians/lefthook)
- [`updatecli/updatecli`](https://github.com/updatecli/updatecli)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants