You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(git-clone): use unique temp file for post_clone_script to avoid race condition (#601)
## Summary
Fixes a race condition when multiple `git-clone` modules with
`post_clone_script` run concurrently.
## Problem
All instances of the git-clone module use the same hardcoded
`/tmp/post_clone.sh` path. When multiple modules run concurrently (or
overlap), they collide on the same temp file, causing:
```
rm: cannot remove '/tmp/post_clone.sh': No such file or directory
```
This results in a non-zero exit code, causing the workspace to appear
unhealthy.
## Solution
Use `mktemp` to generate a unique temporary filename for each module
instance:
```bash
POST_CLONE_TMP=$(mktemp /tmp/post_clone_XXXXXX.sh)
```
This ensures each concurrent execution uses its own temp file,
eliminating the race condition.
Fixes#600
---------
Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com>
Co-authored-by: Matyas Danter <[email protected]>
0 commit comments