thegunner157 opened a new issue, #34145:
URL: https://github.com/apache/airflow/issues/34145

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### What happened
   
   There is a DAG which breaks its SLA every 20 mins. It was active for few 
days. Then DAG was paused and after few hours (about 6) resumed. Suddenly after 
a short while it started to send email alerts about breaking SLAs every minute 
and it couldn't be stopped even after disabling once again DAG. Deleting SLA 
Misses rows via GUI didn't help. It was stopped only by removing SMTP backend.  
   
   
   Implementation of custom sla_miss_callback function:
   
   `def sla_breach_callback(dag_name, sla_limit, email):
       subject = f"SLA Breach in {dag_name}"
       body = (
           f"DAG {dag_name} missed its SLA.\n"
           f"SLA details: \n"
           f"SLA limit is {sla_limit}\n"
       )
       send_email(
           to=email,
           subject=subject,
           html_content=body
       )`
   
   
   ### What you think should happen instead
   
   Mails shouldn't be sent so often and after stopping DAG mails shouldn't 
attempt to do that
   
   ### How to reproduce
   
   Create a DAG which always breaks its SLA and set up schedule every 20 mins. 
Let it be active for a day. Then pause DAG and after 6 hours resume it. Then 
mails should be sent very often. After that disable once again DAG. Use 
following sla_miss_callback function implementation: 
   
   `def sla_breach_callback(dag_name, sla_limit, email):
       subject = f"SLA Breach in {dag_name}"
       body = (
           f"DAG {dag_name} missed its SLA.\n"
           f"SLA details: \n"
           f"SLA limit is {sla_limit}\n"
       )
       send_email(
           to=email,
           subject=subject,
           html_content=body
       )`
   
   ### Operating System
   
   Debian GNU/Linux 11
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   Deployed on AKS with official helm chart.
   
   
   
   ### 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