Skip to content

Fix Airflow migration-job race in CI deploys - #40

Merged
klagrida merged 1 commit into
mainfrom
fix/airflow-migration-job-race
Jun 6, 2026
Merged

Fix Airflow migration-job race in CI deploys#40
klagrida merged 1 commit into
mainfrom
fix/airflow-migration-job-race

Conversation

@klagrida

@klagrida klagrida commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Problem

E2E intermittently fails at the Deploy step with:

Helm release "airflow" was created but has a failed status
Error: jobs.batch "airflow-run-airflow-migrations" not found

The images pull fine and the migration itself succeeds — this is not a timeout. It's a TTL/wait race:

  • migrateDatabaseJob / createUserJob had ttlSecondsAfterFinished: 300 (5 min).
  • helm_release.airflow waits with timeout = 900 (15 min) and wait_for_jobs = true.
  • Under image-pull contention the migration job completes early, but Helm keeps waiting on the slower webserver/scheduler pods. At the 5-min mark the completed migration job is TTL-reaped, so Helm's final wait_for_jobs status check finds it gone and marks the whole release failed.

Fix

Raise ttlSecondsAfterFinished to 1800 (> the 900s helm timeout) on both helper jobs, so they survive the entire wait window and are still cleaned up afterwards. wait_for_jobs = true is preserved, so we still gate on migration success — we just stop the job from vanishing mid-wait.

Validation

The goal of this PR is to let CI (E2E + Cluster Integration) exercise the fix and confirm the flake is gone.

Note on stacking

Branched from ci/bump-actions-node24 (PR #37), so the diff also contains that PR's Node-24 action bumps. If #37 merges first, this narrows to just the one-line TTL change. Base is main because the workflows only trigger on PRs targeting main.

🤖 Generated with Claude Code

The migrateDatabaseJob/createUserJob TTL (300s) was shorter than the
helm_release wait window (timeout = 900s). Under image-pull contention the
migration job finishes early, then Helm keeps waiting on the slower
webserver/scheduler pods. At the 300s mark the completed migration job is
TTL-reaped, so Helm's final wait_for_jobs status check finds it gone and
fails the release with:

  jobs.batch "airflow-run-airflow-migrations" not found

Raise ttlSecondsAfterFinished to 1800s (> the 900s helm timeout) on both
helper jobs so they survive the entire wait window and are still cleaned up
afterwards.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@klagrida
klagrida force-pushed the fix/airflow-migration-job-race branch from cd75884 to 221cfb1 Compare June 6, 2026 10:38
@klagrida
klagrida merged commit 8d943a2 into main Jun 6, 2026
19 checks passed
@klagrida
klagrida deleted the fix/airflow-migration-job-race branch June 6, 2026 11:50
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.

1 participant