Skip to content

Conversation

@amoghrajesh
Copy link
Contributor

closes: #45307

Testing results

DAG:

from time import sleep

from airflow import DAG
from airflow.providers.standard.operators.python import PythonOperator
from datetime import datetime, timedelta


def print_hello():
    print("Going to sleep 100 seconds")
    sleep(100)

with DAG(
    dag_id="tasktimeout",
    schedule=None,
    catchup=False,
) as dag:
    hello_task = PythonOperator(
        task_id="ttimemout",
        execution_timeout=timedelta(seconds=10),
        python_callable=print_hello,
    )

Legacy

  1. No retries
    image (14)

  2. With timeouts
    image (15)

Task sdk

  1. No retries
image
  1. With retries
image

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@amoghrajesh amoghrajesh self-assigned this Dec 31, 2024
Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me.

@amoghrajesh
Copy link
Contributor Author

Will merge this PR with one approval as it is functional. Can handle any issues or shortcomings, if any, in follow ups.

@amoghrajesh amoghrajesh merged commit 7bbda16 into apache:main Jan 1, 2025
46 checks passed
@amoghrajesh amoghrajesh deleted the AIP72-tasktimeout branch January 1, 2025 05:09
HariGS-DB pushed a commit to HariGS-DB/airflow that referenced this pull request Jan 16, 2025
)

Ports the `execution_timeout` for tasks in legacy Airflow to task sdk machinery.
got686-yandex pushed a commit to got686-yandex/airflow that referenced this pull request Jan 30, 2025
)

Ports the `execution_timeout` for tasks in legacy Airflow to task sdk machinery.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port task timeout over to task sdk

2 participants