https://github.com/apache/airflow/pull/12139 added some new params to the scheduler -- we have "cursory" docs for them in the comments in the config file, but we should have a more details docs in the scheduler.rst page.
airflow/jobs/scheduler_job.py
"""
        Reset any TaskInstance still in QUEUED or SCHEDULED states that were
        enqueued by a SchedulerJob that is no longer running.
        :return: the number of TIs reset
        :rtype: int
        """
        self.log.info("Resetting orphaned tasks for active dag runs")
        timeout = conf.getint('scheduler', 'scheduler_health_check_threshold')
        num_failed = (
            session.query(SchedulerJob)
            .filter(
                SchedulerJob.state == State.RUNNING,
                SchedulerJob.latest_heartbeat < (timezone.utcnow() - timedelta(seconds=timeout)),
            )
            .update({"state": State.FAILED})
        )
        if num_failed:
            self.log.info("Marked %d SchedulerJob instances as failed", num_failed)
            Stats.incr(self.__class__.__name__.lower() + '_end', num_failed)
        resettable_states = [State.SCHEDULED, State.QUEUED, State.RUNNING]
        query = (
            session.query(TI)
            .filter(TI.state.in_(resettable_states))
            
            
            
            
            .outerjoin(TI.queued_by_job)
            .filter(or_(TI.queued_by_job_id.is_(None), SchedulerJob.state != State.RUNNING))