tirkarthi commented on issue #22995:
URL: https://github.com/apache/airflow/issues/22995#issuecomment-1099131576
Another scenario is that when the `task_1` being set to mark as failed is
already in failed state and downstream task `task_2` also marked as failure
already. Then marking the state even with downstream as false clears the state.
I have added test case for possible permutations. I have a local branch and
below are the behaviors as per my proposed change.
```python
with DAG("test_mark_task_instance_state_failed_downstream_clear",
start_date=start_date) as dag:
task_1 = EmptyOperator(task_id="task_1")
task_2 = EmptyOperator(task_id="task_2")
task_3 = EmptyOperator(task_id="task_3")
task_1 >> task_2 >> task_3
```
Mark task_1 as Failed with Downstream True
| Task | Start state | End state |
|---|---|---|
| task_1 | Success | Failed |
| task_2 | Success | Failed |
| task_3 | Success | Failed |
| Task | Start state | End state |
|---|---|---|
| task_1 | Success | Failed |
| task_2 | Success | Failed |
| task_3 | Failed | Failed |
Mark task_1 as Failed with Downstream False
| Task | Start state | End state |
|---|---|---|
| task_1 | Success | Failed |
| task_2 | Success | Success |
| task_3 | Failed | None |
| Task | Start state | End state |
|---|---|---|
| task_1 | Failed | Failed |
| task_2 | Success | Success |
| task_3 | Failed | Failed |
| Task | Start state | End state |
|---|---|---|
| task_1 | Success | Failed |
| task_2 | Success | Success |
| task_3 | Success | Success |
--
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]