ephraimbuddy opened a new pull request #15726: URL: https://github.com/apache/airflow/pull/15726
When the executor reports a different taskinstance state to the one in DB, we capture the error but fail to set the taskinstance state to the one reported by the executor with the effect that the taskinstance ends up being in a successful state(in DB) even though it failed. If for example, the first task in a dag is killed by deleting the task pod, the executor marks the task as failed. On getting to the scheduler, the scheduler sees the error but never changes the state of the taskinstance to the one reported by the executor and at the end the taskinstance is marked successful as well as the downstream taskinstances. In the UI, the task appears to never have started and is marked correctly as failed while downstream tasks are skipped This change ensures that if the task pod is killed while running. The correct state(failed) of the taskinstance is set as well as the correct state(upstream_failed) for the downstream taskinstances. --- **^ Add meaningful description above** Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information. In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed. In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x). In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md). -- 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. For queries about this service, please contact Infrastructure at: [email protected]
