Celery: Ignore redelivered message for already-running task#64052
Celery: Ignore redelivered message for already-running task#64052eladkal merged 1 commit intoapache:mainfrom
Conversation
|
@anishgirianish This PR has been converted to draft because it does not yet meet our Pull Request quality criteria. Issues found:
What to do next:
Converting a PR to draft is not a rejection — it is an invitation to bring the PR up to the project's standards so that maintainer review time is spent productively. There is no rush — take your time and work at your own pace. We appreciate your contribution and are happy to wait for updates. If you have questions, feel free to ask on the Airflow Slack. |
|
@anishgirianish can you resolve conflicts and rebase? |
8c5147e to
aebe804
Compare
@eladkal rebased and updated thanks |
aebe804 to
8753cab
Compare
Catch TaskAlreadyRunningError from the supervisor and raise Celery Ignore() to prevent the broker redelivery from being recorded as a task failure. related: apache#58441
8753cab to
e1c2006
Compare
Catch TaskAlreadyRunningError from the supervisor and raise Celery Ignore() to prevent the broker redelivery from being recorded as a task failure. related: apache#58441
Catch TaskAlreadyRunningError from the supervisor and raise Celery Ignore() to prevent the broker redelivery from being recorded as a task failure. related: apache#58441
Catch TaskAlreadyRunningError from the supervisor and raise Celery Ignore() to prevent the broker redelivery from being recorded as a task failure.
related: #58441
Was generative AI tooling used to co-author this PR?
Summary
Catch TaskAlreadyRunningError from the supervisor and raise Celery Ignore() to prevent a broker redelivery from being recorded as a task failure.
In Airflow 3.x, the scheduler processes executor events for RUNNING tasks (not just QUEUED as in 2.x). When Celery redelivers a message for a task that's already running, the worker hits a 409 from the API server. Without this fix, Celery records it as FAILURE, and the scheduler marks the still-running task as failed.
related: #58441
depends on: #60855
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.