You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "adirhmonday (via GitHub)" <gi...@apache.org> on 2026/09/03 09:06:27 UTC
[I] DeadlineAlert records not created for updated DAGs — SLA alerts silently stop firing after DAG re-serialization [airflow]
adirhmonday opened a new issue, #72471:
URL: https://github.com/apache/airflow/issues/72471
### Apache Airflow version
3.2.2
### If "Other Airflow 2 version" selected, which one?
_No response_
### What happened?
When a DAG is updated (any code change that produces a new `serialized_dag` row), `DeadlineAlert` records are not created for the new `serialized_dag`. All subsequent `dag_run`s for that DAG silently produce no `Deadline` entries and never fire deadline callbacks.
**Root cause**
In `SerializedDagModel.write_dag()` (`airflow/models/serialized_dag.py`), when the deadline definition hasn't changed between versions, `_try_reuse_deadline_uuids()` returns the existing UUIDs and the code sets:
```python
# serialized_dag.py ~line 646-651
if deadline_uuid_mapping is not None:
# All deadlines matched — reuse the UUIDs to preserve hash.
# Clear the mapping since the alert rows already exist in the DB;
# no need to delete and recreate identical records.
dag.data["dag"]["deadline"] = existing_deadline_uuids
deadline_uuid_mapping = {}
```
Then in the new `serialized_dag` creation path (when `has_task_instances=True`):
```python
# line 734
cls._create_deadline_alert_records(new_serialized_dag, deadline_uuid_mapping)
```
Since `deadline_uuid_mapping = {}`, `_create_deadline_alert_records` returns immediately (`if not uuid_mapping: return`) — the new `serialized_dag` gets no `deadline_alert` rows.
When a `dag_run` is created, `definitions/dag.py` queries:
```sql
SELECT * FROM deadline_alert WHERE serialized_dag_id = <new_serialized_dag_id>
```
Finds nothing → no `Deadline` row inserted → triggerer never fires the callback.
The `{}` optimization is correct for the in-place UPDATE path (same `serialized_dag` row, existing `deadline_alert` records stay valid). It is wrong for the INSERT path (new row, no `deadline_alert` records exist for the new `serialized_dag_id`).
### What you think should happen instead?
`deadline_alert` records should be created for every new `serialized_dag` row, regardless of whether the deadline definition changed.
**Suggested fix**
In `_create_deadline_alert_records`, when the new `serialized_dag` path is taken (INSERT, not UPDATE), generate new UUIDs and create new `deadline_alert` records even when the deadline definition matches the previous version. The empty-mapping optimization should only apply to the in-place UPDATE path (lines 691–713).
### How to reproduce
1. Deploy a DAG with a `DeadlineAlert` — verify a `deadline_alert` record is created
2. Make any code change to the DAG file that produces a new `dag_version` (e.g. add a comment) without changing the deadline definition
3. Wait for git-sync to pick up the new version
4. Trigger a `dag_run` and wait past the deadline
5. No alert fires; the `deadline` table has no row for this run
### Operating System
N/A
### Versions of Apache Airflow Providers
N/A
### Deployment
Other 3rd-party Helm chart
### 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: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] DeadlineAlert records not created for updated DAGs — SLA alerts silently stop firing after DAG re-serialization [airflow]
Posted by "jasperjonkhans (via GitHub)" <gi...@apache.org>.
jasperjonkhans commented on issue #72471:
URL: https://github.com/apache/airflow/issues/72471#issuecomment-5523559011
This appears to describe the same failure fixed by #68734, including the non-deadline edit and new serialized_dag insertion path.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] DeadlineAlert records not created for updated DAGs — SLA alerts silently stop firing after DAG re-serialization [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #72471:
URL: https://github.com/apache/airflow/issues/72471#issuecomment-5523333736
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] DeadlineAlert records not created for updated DAGs — SLA alerts silently stop firing after DAG re-serialization [airflow]
Posted by "bingqin2 (via GitHub)" <gi...@apache.org>.
bingqin2 commented on issue #72471:
URL: https://github.com/apache/airflow/issues/72471#issuecomment-5637169282
Adding the release status to @jasperjonkhans's pointer, since it decides whether upgrading helps: #68734 landed on `main` on 2026-07-15, after 3.3.0 was cut, and the backport to `v3-3-test` (#71859) merged on 2026-09-07, after 3.3.1. So neither 3.2.2 nor 3.3.1 contains the fix; it will ship with the next 3.3.x patch release and with 3.4.0. Based on the analysis above, a workaround until then is to change the deadline definition together with the Dag edit, which forces new `deadline_alert` rows to be written for the new `serialized_dag`.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org