Fix airflow db clean hang on MySQL when delete fails#66296
Open
Vamsi-klu wants to merge 2 commits into
Open
Conversation
|
@Vamsi-klu can you close your PR, I have made the fix 4 days ago and waiting for the #PR-66249 approval for merge and close this issue. |
9967327 to
6e2e0bf
Compare
The check-newsfragment-pr-number CI job requires the newsfragment filename to match the PR number, not the linked issue number.
6e2e0bf to
7dec317
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a MySQL hang in
airflow db clean --skip-archivewhen a delete fails on a foreign-key constraint.On the failure path,
_do_delete()now rolls back the session before dropping the temporary archive table, and the drop uses the session's active connection instead of checking out a new pooled connection. This prevents metadata-lock contention from leaving the cleanup command stuck indefinitely.Also adds:
Validation:
prek run --from-ref main --stage pre-commitprek run --from-ref main --stage manualairflow-core/tests/unit/utils/test_db_cleanup.pyin Breeze (57 passed, 1 skipped)breeze ci selective-check --commit-ref HEADindicates the shared test utility change expands the CI matrix beyond what was practical to run locallycloses: #66177
Was generative AI tooling used to co-author this PR?
Generated-by: Codex following the guidelines