full_filepath=dag.fileloc,
                    dag_id=self.dag_id,
                    run_id=self.run_id,
                    is_failure_callback=False,
                    processor_subdir=None if dag_model is None else dag_model.processor_subdir,
                    msg="success",
                )
        
        elif unfinished.should_schedule and not are_runnable_tasks:
            self.log.error("Task deadlock (no runnable tasks); marking run %s failed", self)
            self.set_state(DagRunState.FAILED)
            self.notify_dagrun_state_changed(msg="all_tasks_deadlocked")
            if execute_callbacks:
                dag.handle_callback(self, success=False, reason="all_tasks_deadlocked", session=session)
            elif dag.has_on_failure_callback:
                from airflow.models.dag import DagModel
                dag_model = DagModel.get_dagmodel(dag.dag_id, session)
                callback = DagCallbackRequest(
                    full_filepath=dag.fileloc,
                    dag_id=self.dag_id,
                    run_id=self.run_id,
                    is_failure_callback=True,
                    processor_subdir=None if dag_model is None else dag_model.processor_subdir,
                    msg="all_tasks_deadlocked",
                )
        
        else:
            self.set_state(DagRunState.RUNNING)
        if self._state == DagRunState.FAILED or self._state == DagRunState.SUCCESS:
            msg = (