xBis7 commented on code in PR #43941:
URL: https://github.com/apache/airflow/pull/43941#discussion_r1885703259
##########
airflow/jobs/scheduler_job_runner.py:
##########
@@ -1113,6 +1294,20 @@ def _run_scheduler_loop(self) -> None:
self.log.debug("Waiting for processors to finish since
we're using sqlite")
self.processor_agent.wait_until_finished()
+ # This is using a new session.
+ self._end_spans_of_externally_ended_ops()
+
+ # Pass a reference to the dictionary.
+ # Any changes made by a dag_run instance, will be reflected to
the dictionaries of this class.
+ DagRun.set_active_spans(
+ active_dagrun_spans=self.active_dagrun_spans,
active_ti_spans=self.active_ti_spans
+ )
+
+ # local import due to type_checking.
+ from airflow.executors.base_executor import BaseExecutor
+
+
BaseExecutor.set_active_spans(active_spans=self.active_ti_spans)
Review Comment:
This is a pass by reference. You are right, I moved it out of the loop.
--
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]