You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "dabla (via GitHub)" <gi...@apache.org> on 2026/01/14 08:25:30 UTC
Re: [I] Tasks are immediately restarted after unknown "Server indicated the task shouldn't be running anymore", resulting in HTTP 409 [airflow]
dabla commented on issue #59378:
URL: https://github.com/apache/airflow/issues/59378#issuecomment-3748385866
> Scheduler A Scheduler B | | RUNNING | | | Task starts | | | |--------------> SCHEDULED | | Heartbeat (409) | | | Task killed & retried | I’m new to open source and this is my first PR, so feedback is very welcome.
>
> While investigating an issue with multiple schedulers, I observed that a TaskInstance can regress from RUNNING back to SCHEDULED due to a race condition. This leads to heartbeat conflicts (409), premature task termination, and repeated task retries.
>
> This PR adds a small guard in TaskInstance.set_state() to prevent the invalid RUNNING → SCHEDULED transition while allowing all valid state transitions. This avoids killing already-running tasks and preserves correct execution.
>
> Tested locally with a multi-scheduler setup.
@abhijeets25012-tech I can't find the PR you're mentioning?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org