Skip to content

Restarting a single mapped task restarts all sibling tasks as well #54779

@MarcusCramer91

Description

@MarcusCramer91

Apache Airflow version

3.0.4

If "Other Airflow 2 version" selected, which one?

No response

What happened?

Cannot restart a single mapped task. It always restarts all sibling mapped tasks as well. I found this old issue #24699 so I thought it should be working, but doesn't for me. We have multiple issues here:

  1. When clearing the individual task it shows all siblings in the "Downstream" selection.
  2. It re-runs all sibling tasks. Cannot tell for certain this isn't just a UI bug in this simple example. But in my real-world use case, where Airflow triggers Google Cloud Run Jobs, it does spawn n Cloud Run Jobs upon restart.
  3. It also re-runs all downstream tasks for all map indices.
  4. For previous task executions, upon UI reload, I only get "::group::Log message source details: sources=["Could not read served logs: 'TaskInstanceHistory' object has no attribute 'triggerer_job'"]" and not the actual logs.

Or am I misunderstanding this feature?

What you think should happen instead?

Only the selected mapped task should be restarted.

The logs should properly show up in the UI for previous task tries.

Only downstream tasks with the same map index should be re-run (not sure this is easily possible or intended, but without it I don't see how restarting individual tasks would be of much use).

How to reproduce

@task
def task1(val: str):
    print("Task 2" + val)

@task
def task2(val: str):
    print("Task 2" + val)

@dag(dag_id="test")
def get_dag() -> None:
    t1 = task1.expand(val=["foo", "bar"])
    t2 = task2.expand(val=["foo", "bar"])
    t1 >> t2

get_dag()

Run once. Then re-run an individual task of task1.

Operating System

Debian GNU/Linux 12 (bookworm)

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions