Skip to content

Task is taking more than 5 minutes to fail #50654

Description

@atuls4441

Apache Airflow version

main (development)

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

No response

What happened?

When there are 2 assets with same name and there is task which has these 2 assets as outlet then task is taking more than 5 minutes to fail.

Image

What you think should happen instead?

No response

How to reproduce

Run below dag on main latest and notice 'task1' is taking more than 5 minutes to fail

from airflow.providers.standard.operators.empty import EmptyOperator
from airflow.providers.standard.operators.python import PythonOperator
from airflow.sdk import Asset
from airflow.sdk import DAG
from airflow.utils.trigger_rule import TriggerRule
from pendulum import today

from dags.plugins.airflow_dag_introspection import assert_the_task_states

left = Asset(name='asset_name')
right = Asset(name='asset_name', uri="asset_uri")

with DAG(
    dag_id="asset_with_duplicate_name",
    start_date=today('UTC').add(days=-2),
    schedule=None,
    max_active_runs=1,
    tags=["asset", "AIP-74"],
) as dag:
    task1 = EmptyOperator(task_id='task1', outlets=[left, right])
    status = PythonOperator(
        task_id="assert_task_status",
        python_callable=assert_the_task_states,
        op_args=[{"task1": "failed"}],
        trigger_rule=TriggerRule.ALL_DONE,
    )
    task1 >> status

Operating System

Linux

Versions of Apache Airflow Providers

No response

Deployment

Other

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

Activity

  1. added
    priority:mediumBug that should be fixed before next release but would not block a release
    on May 15, 2025
  2. atuls4441 commented on May 16, 2025

    @atuls4441
    ContributorAuthor

    @Lee-W this is happening with a Dag which is trying to use 2 assets with the same name.
    I am expecting task to fail fast.

  3. self-assigned this
    on May 17, 2025
  4. Lee-W commented on May 19, 2025

    @Lee-W
    Member

    It fails immediately on my end. Is there another setup I can try?

  5. added
    Can't ReproduceThe problem cannot be reproduced
    and removed
    Can't ReproduceThe problem cannot be reproduced
    needs-triagelabel for new issues that we didn't triage yet
    on May 19, 2025
  6. Lee-W commented on May 19, 2025

    @Lee-W
    Member

    another potential bug found, let's see whether that fixes this issue

  7. added this to the Airflow 3.0.2 milestone on May 21, 2025
  8. Lee-W commented on May 23, 2025

    @Lee-W
    Member

    Due to the latest task sdk change, this issue occurs in all tasks instead of just the empty operator. The checking logic is totally removed somehow. New root cause found. A total rework needed

  9. phanikumv commented on Jun 2, 2025

    @phanikumv
    Contributor
  10. Lee-W commented on Jun 2, 2025

    @Lee-W
    Member

    After a few more tests, I discovered that my statement was not accurate. The API server as a whole doesn't die. Only the API endpoint itself dies without being correctly handled. It's still the root cause of why the task is hanging. But what we need to do is not handle

    but

    .

    The task fails to update it state correctly and hangs there till it fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:corekind:bugThis is a clearly a bugpriority:mediumBug that should be fixed before next release but would not block a release

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions