Mavtti opened a new issue #18746:
URL: https://github.com/apache/airflow/issues/18746


   ### Apache Airflow version
   
   2.0.2
   
   ### Operating System
   
   Debian
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   MWAA
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   When calling the dag with a dagrun_timeout, if it reaches the limit, a 
SIGTERM is sent but the function used for on_failure_callback is not called.
   
   ### What you expected to happen
   
   _No response_
   
   ### How to reproduce
   
   import logging
   from datetime import datetime
   from datetime import timedelta
   
   from airflow import DAG
   from airflow.operators.python import PythonOperator
   from macros.utils import job_config
   from operators.slack import SlackOperator
   
   
   # Handling naming and environment logic - do not change
   config = job_config(__name__)
   logging.getLogger().setLevel(logging.INFO)
   
   
   # These args are passed on to each operator, and can be overriden on a 
per-task basis during operator initialization.
   def sleep_timeout(**kwargs):
       raise Exception("test")
   
   
   def fail_callback(context):
       logging.info("FAILED test")
       logging.info(context)
   
   
   default_args = {
       "owner": "test",
       "start_date": datetime(2021, 7, 6),
       "on_failure_callback": fail_callback,
   }
   
   
   with DAG(
       dag_id=config["name"],
       default_args=default_args,
       dagrun_timeout=timedelta(seconds=5),
       schedule_interval="@daily",
       catchup=False,
       tags=[config["type"], config["env"]],
   ) as dag:
   
       crawl_task = PythonOperator(task_id="sleep_timeout", 
python_callable=sleep_timeout, dag=dag, provide_context=True)
   
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to