Vamsi-klu opened a new pull request, #66296: URL: https://github.com/apache/airflow/pull/66296
Fixes a MySQL hang in `airflow db clean --skip-archive` when 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: - unit coverage for rollback-before-drop ordering - a MySQL backend regression test for the deadlock case - a Postgres backend regression test for the failure path - a newsfragment Validation: - `prek run --from-ref main --stage pre-commit` - `prek run --from-ref main --stage manual` - targeted MySQL and Postgres regression tests in Breeze - full `airflow-core/tests/unit/utils/test_db_cleanup.py` in Breeze (`57 passed, 1 skipped`) - `breeze ci selective-check --commit-ref HEAD` indicates the shared test utility change expands the CI matrix beyond what was practical to run locally closes: #66177 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Codex Generated-by: Codex following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
