The GitHub Actions job "Tests" on airflow.git/fix/git-bundle-clone-per-task has 
failed.
Run started by GitHub user Arunodoy18 (triggered by Arunodoy18).

Head commit for run:
1a887a15afee7c2c2a0acd17a81e28f3bc782b5e / Arunodoy18 <[email protected]>
Fix GitDagBundle race condition in concurrent task execution

When LocalExecutor runs multiple tasks concurrently that use the same
GitDagBundle version, the existing _clone_repo_if_required() method had
a race condition where:

1. Multiple processes check if version directory exists (all see False)
2. All processes start cloning to the same directory simultaneously
3. Partial clones become visible to other processes mid-operation
4. FileNotFoundError or corrupted repos can occur during checkout

This fix implements atomic clone operations:
- Clone to temporary directory with PID-based naming
- Use atomic os.rename() to make clone visible only when complete
- Validate existing repos before reuse (check repo.head)
- Handle rename race gracefully when another process wins
- Clean up temp directories on any failure

This ensures each version directory is created atomically and tasks
safely reuse valid existing clones without race conditions.

Test coverage includes:
- Concurrent clone attempts
- Existing repo reuse
- Corrupted repo detection and replacement
- Temp directory cleanup on failure
- Atomic rename race handling
- Multiple version isolation

Report URL: https://github.com/apache/airflow/actions/runs/21705458611

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to