Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stats of a dynamically expended task disappear after an automatic retry of a failed task #44245

Open
2 tasks done
shahar1 opened this issue Nov 21, 2024 · 1 comment
Open
2 tasks done
Assignees
Labels
area:core area:dynamic-task-mapping AIP-42 area:UI Related to UI/UX. For Frontend Developers. kind:bug This is a clearly a bug

Comments

@shahar1
Copy link
Contributor

shahar1 commented Nov 21, 2024

Apache Airflow version

2.10.2

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

No response

What happened?

At least in the classic UI, when a task gets expanded dynamically, any retried failed task makes its other stats disappear.

What you think should happen instead?

No response

How to reproduce

import random
from datetime import datetime
from airflow import DAG
from airflow.operators.python import PythonOperator

def random_fail_task(task_id):
    if random.random() < 0.5: 
        raise Exception(f"Task {task_id} failed")
    print(f"Task {task_id} succeeded")


def all_success(task_id):
    print(f"Task {task_id} succeeded")

with DAG(
    dag_id='dynamic_task_expansion',
    start_date=datetime(2023, 1, 1),
    schedule_interval=None,
    catchup=False,
) as dag:

    tasks = PythonOperator.partial(
        task_id='task',
        ## Uncoment below for the second coherence check
        # retries=0,
        python_callable=random_fail_task, # <- Change to all_success for first coherence checks
    ).expand(op_args=[[i] for i in range(100)])

Coherence checks

  1. When replacing random_fail_task with random_all_success_task , we get the exact number of tasks, all succesful (100):
    image

  2. When we apply retries=0 with random_fail_task the total number of tasks (succesful+failed) is once again 100:
    image

Reproduction

  1. When running the random_fail_task task with retries>=0 - some of the mapped tasks fail and are up for retry:
    image

  2. Immediately when failed tasks are triggered for re-run, some of the other tasks disappear from the UI:
    image

  3. And finally we're left with less tasks than what we started:
    image

When looking the the "Mapped Tasks" tab, all of the tasks still are still there.

Operating System

Linux

Versions of Apache Airflow Providers

No response

Deployment

Google Cloud Composer

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

@shahar1 shahar1 added kind:bug This is a clearly a bug area:core area:UI Related to UI/UX. For Frontend Developers. area:dynamic-task-mapping AIP-42 labels Nov 21, 2024
@shahar1 shahar1 self-assigned this Nov 21, 2024
@ashb
Copy link
Member

ashb commented Nov 21, 2024

First idea: look at the network inspector and see if the issue is in the API response or just in the presentation of the data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core area:dynamic-task-mapping AIP-42 area:UI Related to UI/UX. For Frontend Developers. kind:bug This is a clearly a bug
Projects
None yet
Development

No branches or pull requests

2 participants