TECH-Airflow-Engineering-Team opened a new issue, #33855:
URL: https://github.com/apache/airflow/issues/33855
### Apache Airflow version
Other Airflow 2 version (please specify below)
### What happened
Its happening on airflow 2.0.1 version
Here Executed failure callback called 3 times for same execution date
instead of only once.
Here is log from scheduler:
{"asctime": "2023-08-28 20:32:27,218", "name": "airflow.processor",
"filename": "scheduler_job.py", "lineno": 615, "levelname": "INFO", "message":
"Executed failure callback for <TaskInstance:
servicenow_example.servicenow-test-task2 2023-08-28 20:15:00+00:00
[up_for_retry]> in state up_for_retry"}
{"asctime": "2023-08-28 20:34:41,861", "name": "airflow.processor",
"filename": "scheduler_job.py", "lineno": 615, "levelname": "INFO", "message":
"Executed failure callback for <TaskInstance:
servicenow_example.servicenow-test-task2 2023-08-28 20:15:00+00:00
[up_for_retry]> in state up_for_retry"}
{"asctime": "2023-08-28 20:34:41,875", "name": "airflow.processor",
"filename": "scheduler_job.py", "lineno": 615, "levelname": "INFO", "message":
"Executed failure callback for <TaskInstance:
servicenow_example.servicenow-test-task1 2023-08-28 20:15:00+00:00
[up_for_retry]> in state up_for_retry"}
Here is DAG Code:
from datetime import datetime, timedelta
from airflow.operators.python import PythonOperator
def pagerduty_incident(context):
print("pagerduty_incident is created")
default_args = {
'owner': 'airflow-test',
'description': 'example of pagerduty alert',
'start_date': datetime(2021,3,20),
'depends_on_past': False,
'retries': 3,
'retry_delay': timedelta(minutes=2),
"on_failure_callback": pagerduty_incident,
}
# this python function is intended to fail,
# so that this task which uses this python function will send out an alert
def print_hello():
print("HELLO!!!!!!!!!")
test_var = 'hello' + int(100)
with DAG(
dag_id='example_servicenow',
default_args=default_args,
schedule_interval='*/15 * * * *',
tags=['servicenow', 'example'],
catchup=False) as dag:
servicenow_test1 = PythonOperator(
task_id='servicenow-test-task1',
python_callable=print_hello
)
servicenow_test2 = PythonOperator(
task_id='servicenow-test-task2',
python_callable=print_hello
)
servicenow_test3 = PythonOperator(
task_id='servicenow-test-task3',
python_callable=print_hello
)
servicenow_test1 >> servicenow_test3
servicenow_test2
### What you think should happen instead
Here Executed failure callback called 3 times for same execution date
instead of only once.
### How to reproduce
DAG code is attached
### Operating System
PRETTY_NAME="Debian GNU/Linux 10 (buster)" NAME="Debian GNU/Linux"
VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=debian
HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
### Versions of Apache Airflow Providers
2.0.1
### 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
- [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]