Sathvik-Chowdary-Veerapaneni commented on code in PR #63692:
URL: https://github.com/apache/airflow/pull/63692#discussion_r3260620864


##########
airflow-core/src/airflow/models/dagrun.py:
##########
@@ -1331,16 +1331,26 @@ def produce_dag_callback(
     ) -> DagCallbackRequest | None:
         """Create a callback request for the DAG, or execute the callbacks 
directly if instructed, and return None."""
         if not execute:
+            try:
+                context_from_server = DagRunContext(
+                    dag_run=self,
+                    last_ti=relevant_ti,
+                )
+            except Exception:
+                self.log.exception(
+                    "Failed to build DagRunContext for dag_id=%s run_id=%s; "
+                    "sending callback with minimal context",
+                    self.dag_id,
+                    self.run_id,
+                )
+                context_from_server = None

Review Comment:
   Fair point from both of you — running a callback with partial context is 
worse than not running it. Removed the fallback entirely in 29274fd. PR is now 
scoped to just `callback_requests.py` and `scheduler_job_runner.py`.



##########
airflow-core/src/airflow/dag_processing/manager.py:
##########
@@ -561,6 +561,15 @@ def _fetch_callbacks(
             ]
             for callback in callbacks:
                 req = callback.get_callback_request()
+                if req.bundle_name not in bundle_names:
+                    self.log.warning(
+                        "Callback for dag_id=%s has bundle_name=%r which is 
not served by "
+                        "this DAG processor (serving bundles: %s). Skipping.",
+                        getattr(req, "dag_id", "unknown"),
+                        req.bundle_name,
+                        bundle_names,

Review Comment:
   Right, it was redundant. Removed in d427ae6.



-- 
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