Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions airflow-core/src/airflow/jobs/scheduler_job_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ def register_signals(self) -> ExitStack:

def _exit_gracefully(self, signum: int, frame: FrameType | None) -> None:
"""Clean up processor_agent to avoid leaving orphan processes."""
self._end_active_spans()
if self._is_tracing_enabled():
self._end_active_spans()

if not _is_parent_process():
# Only the parent process should perform the cleanup.
Expand Down Expand Up @@ -1931,7 +1932,8 @@ def _schedule_dag_run(
return callback

if (
dag_run.scheduled_by_job_id is not None
self._is_tracing_enabled()
and dag_run.scheduled_by_job_id is not None
and dag_run.scheduled_by_job_id != self.job.id
and self.active_spans.get(dag_run.run_id) is None
):
Expand Down
Loading