You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ephraimbuddy (via GitHub)" <gi...@apache.org> on 2026/02/12 13:35:25 UTC
[PR] Fix scheduler crash when enqueuing TI with null dag_version_id [airflow]
ephraimbuddy opened a new pull request, #61813:
URL: https://github.com/apache/airflow/pull/61813
After upgrade from AF2, TIs might be without dag_version_id since we don't enforce this at the DB level. The solution here is to skip enqueing such TIs until the verify_integrity runs which would update the dag_version_id of the TI.
Initially, the TI would be stuck but would later be cleared when the handle tasks stuck in queued deems it fit.
--
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: [PR] Fix scheduler crash when enqueuing TI with null dag_version_id [airflow]
Posted by "ashb (via GitHub)" <gi...@apache.org>.
ashb commented on code in PR #61813:
URL: https://github.com/apache/airflow/pull/61813#discussion_r2798968039
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -920,6 +920,12 @@ def _get_sentry_integration(executor: BaseExecutor) -> str:
if ti.dag_run.state in State.finished_dr_states:
ti.set_state(None, session=session)
continue
+ if not ti.dag_version_id:
Review Comment:
```suggestion
# This is possible to hit if a DagRun was in progress during a 2->3 upgrade
if not ti.dag_version_id:
```
--
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: [PR] Fix scheduler crash when enqueuing TI with null dag_version_id [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on code in PR #61813:
URL: https://github.com/apache/airflow/pull/61813#discussion_r2798989222
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -920,6 +920,13 @@ def _get_sentry_integration(executor: BaseExecutor) -> str:
if ti.dag_run.state in State.finished_dr_states:
ti.set_state(None, session=session)
continue
+ # This is possible to hit if a DagRun was in progress during a 2->3 upgrade
+ if not ti.dag_version_id:
+ self.log.error(
Review Comment:
cc @ashb
--
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: [PR] Fix scheduler crash when enqueuing TI with null dag_version_id [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy merged PR #61813:
URL: https://github.com/apache/airflow/pull/61813
--
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: [PR] Fix scheduler crash when enqueuing TI with null dag_version_id [airflow]
Posted by "ashb (via GitHub)" <gi...@apache.org>.
ashb commented on code in PR #61813:
URL: https://github.com/apache/airflow/pull/61813#discussion_r2799094919
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -920,6 +920,13 @@ def _get_sentry_integration(executor: BaseExecutor) -> str:
if ti.dag_run.state in State.finished_dr_states:
ti.set_state(None, session=session)
continue
+ # This is possible to hit if a DagRun was in progress during a 2->3 upgrade
+ if not ti.dag_version_id:
+ self.log.error(
Review Comment:
Maybe warning and add "pause this dag or ensure it gets parsed to fix"?
--
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: [PR] Fix scheduler crash when enqueuing TI with null dag_version_id [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on code in PR #61813:
URL: https://github.com/apache/airflow/pull/61813#discussion_r2799274455
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -920,6 +920,13 @@ def _get_sentry_integration(executor: BaseExecutor) -> str:
if ti.dag_run.state in State.finished_dr_states:
ti.set_state(None, session=session)
continue
+ # This is possible to hit if a DagRun was in progress during a 2->3 upgrade
+ if not ti.dag_version_id:
+ self.log.error(
Review Comment:
I added "This would get unstuck and dag_version_id updated." since it doesn't continuously warn
--
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: [PR] Fix scheduler crash when enqueuing TI with null dag_version_id [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #61813:
URL: https://github.com/apache/airflow/pull/61813#issuecomment-3895908022
### Backport successfully created: v3-1-test
<table>
<tr>
<th>Status</th>
<th>Branch</th>
<th>Result</th>
</tr>
<tr>
<td>✅</td>
<td>v3-1-test</td>
<td><a href="https://github.com/apache/airflow/pull/61846"><img src="https://img.shields.io/badge/PR-61846-blue" alt="PR Link"></a></td>
</tr>
</table>
--
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: [PR] Fix scheduler crash when enqueuing TI with null dag_version_id [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on code in PR #61813:
URL: https://github.com/apache/airflow/pull/61813#discussion_r2798982212
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -920,6 +920,13 @@ def _get_sentry_integration(executor: BaseExecutor) -> str:
if ti.dag_run.state in State.finished_dr_states:
ti.set_state(None, session=session)
continue
+ # This is possible to hit if a DagRun was in progress during a 2->3 upgrade
+ if not ti.dag_version_id:
+ self.log.error(
Review Comment:
Should this be error log level?
--
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: [PR] Fix scheduler crash when enqueuing TI with null dag_version_id [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on code in PR #61813:
URL: https://github.com/apache/airflow/pull/61813#discussion_r2798982212
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -920,6 +920,13 @@ def _get_sentry_integration(executor: BaseExecutor) -> str:
if ti.dag_run.state in State.finished_dr_states:
ti.set_state(None, session=session)
continue
+ # This is possible to hit if a DagRun was in progress during a 2->3 upgrade
+ if not ti.dag_version_id:
+ self.log.error(
Review Comment:
Should this be warning log level?
--
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