Repository navigation
Replies: 1 comment
|
This looks like a race condition around the shared repository workspace rather than anything in your Ansible/Python code. The errors: are what I'd expect if multiple jobs are updating or replacing the same checkout at the same time. Since sequential runs work fine and the failures happen before the playbook starts, I'd first try giving each parallel execution its own working copy instead of letting 20–30 jobs operate on the same Semaphore-managed repository directory. For that level of concurrency, I'd probably keep a read-only/local mirror of the repo and create a temporary checkout/worktree for each job, for example: WORKDIR=$(mktemp -d)
git clone /path/to/repo-mirror "$WORKDIR"
cd "$WORKDIR"
# run the job here
rm -rf "$WORKDIR"Another option would be separate runners/instances if that's practical in your setup. I wouldn't try to solve this with a Git lock around the shared workspace unless you're OK with effectively serializing the repository update step. That would avoid concurrent Git mutations, but it also defeats part of the reason for enabling parallel tasks. So for 20–30 concurrent API-triggered runs, I'd aim for:
I'd also test the same workload with isolated clones outside Semaphore. If that runs reliably, it would be a pretty strong indication that the shared repository workspace is where the contention is happening. I don't see a documented Semaphore setting that guarantees a fresh isolated repository checkout for every parallel execution, so I'd be interested to hear from the maintainers whether this is expected behavior with |
Uh oh!
There was an error while loading. Please reload this page.
Hi Team,
We are observing repository workspace corruption when enabling “Allow Parallel Tasks” for a Semaphore task template executing Ansible + Python workflows from a GitHub repository.
Environment:
Current behavior:
When parallel execution is enabled, tasks intermittently fail during repository update/checkout phase before Ansible/Python execution starts.
Observed errors:
The issue appears related to concurrent mutation/update of the same repository workspace under:
Questions:
Important context:
Any guidance/recommended production-grade configuration would be greatly appreciated.
Thanks.
All reactions