abhijeets25012-tech commented on issue #59378:
URL: https://github.com/apache/airflow/issues/59378#issuecomment-3692628695
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.
--
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]