bbovenzi commented on code in PR #73915:
URL: https://github.com/apache/airflow/pull/73915#discussion_r4275807461
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -212,22 +212,11 @@ def _eager_load_dag_run_for_validation() ->
tuple[LoaderOption, LoaderOption]:
def _resolve_ti_callback_bundle_info(ti: TaskInstance) -> tuple[str, str |
None, Any]:
- """
- Resolve the bundle name/version/version-data needed to build a
TaskCallbackRequest or EmailRequest.
-
- Used by the heartbeat-timeout purge path. Encapsulates the bundle-pinning
semantics: fall back
- to ``dag_model`` for legacy tasks with no ``dag_version`` (pre-AIP-66
migrations), and leave the
- bundle version unpinned when the dag run itself wasn't pinned
(``disable_bundle_versioning``),
- so the callback runs against the same code as the task did.
``process_executor_events`` inlines
- the same resolution for its externally-killed-task path.
- """
+ """Resolve bundle metadata for task callbacks and emails using the run's
execution bundle."""
bundle_name = ti.dag_version.bundle_name if ti.dag_version else
ti.dag_model.bundle_name
- bundle_version = (
- ti.dag_version.bundle_version
- if ti.dag_version and ti.dag_run.bundle_version is not None
- else ti.dag_run.bundle_version
- )
- version_data = _resolve_version_data(ti.dag_version,
ti.dag_run.bundle_version)
+ # A code-only update can advance the DagVersion's bundle while the run
stays pinned.
+ bundle_version = ti.dag_run.bundle_version
+ version_data = _resolve_version_data(ti.dag_run.created_dag_version,
ti.dag_run.bundle_version)
Review Comment:
`ti.dag_run.created_dag_version.version_data` can already be overwritten at
this. Let's just add a check inside this function that
`dag_version.bundle_version == bundle_version`
--
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]