Skip to content

Tasks in the upstream_failed state should be cleared when the upstream failed tasks are cleared #31510

Closed

Description

@dstaple

Description

When a failed task is deleted or cleared, any downstream tasks should be cleared from the "upstream_failed" state. This should not require users to manually select the "downstream" and "recursive" options, which are more invasive and will clear downstream tasks regardless of their state. In general, if a task is in the "upstream failed" state, it should actually have upstream tasks that are in the failed state.

Use case/motivation

When a user clears or deletes a failed task, downstream tasks can be left in the "upstream_failed" state. This happens any time a failed task is deleted via the Browse, Task Instances search feature. It also happens in the graph view if a failed task is cleared without downstream and recursive checked.

The issue with the current behavior is if a previously failed tasks succeeds after being cleared, then any downstream tasks will be indefinitely orphaned in an inconsistent state where they say "upstream_failed", but actually, these tasks no longer have any upstream tasks that have failed.

This behavior is also inconsistent with what happens when you manually mark a task as success in the graph view: In that scenario, all downstream tasks that were previously in the "upstream_failed" state are immediately cleared and will attempt to run as expected.

Finally, the current behavior limits the usability of clearing tasks via the task search feature and makes it prone to user error.

The behavior that occurs when tasks are manually marked as success makes more sense because it prevents tasks from being orphaned. Clearing a task and having it succeed should have the same behavior as manually marking a task as success: namely downstream tasks that are specifically in the upstream_failed state should be cleared.

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. hussein-awala commented on May 25, 2023

    @hussein-awala
    Member

    Why do you think that only_failed flag is not enough to achieve what you want to do?

    IMO implementing your suggestion as the default behavior is unlikely to occur. Even if we manually change the task's state to success, we often need to rerun it when we clear the upstream task, as it relies on the output of one of its upstream tasks.

  2. locked and limited conversation to collaborators on May 25, 2023
  3. converted this issue into a discussion #31540 on May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:featureFeature Requestsneeds-triagelabel for new issues that we didn't triage yet

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions