"""
        Handle case where self.task_runner exits by itself or is externally killed.
        Don't run any callbacks.
        """
        
        self.terminating = True
        self._log_return_code_metric(return_code)
        is_deferral = return_code == TaskReturnCode.DEFERRED.value
        if is_deferral:
            self.log.info("Task exited with return code %s (task deferral)", return_code)
            _set_task_deferred_context_var()
        else:
            self.log.info("Task exited with return code %s", return_code)
        if not (self.task_instance.test_mode or is_deferral):
            if conf.getboolean("scheduler", "schedule_after_task_execution", fallback=True):
                self.task_instance.schedule_downstream_tasks(max_tis_per_query=self.job.max_tis_per_query)
    def on_kill(self):