Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only mark SchedulerJobs as failed, not any jobs (apache#19375)
In `adopt_or_reset_orphaned_tasks`, we set any SchedulerJobs that have failed `scheduler_health_check_threshold` to failed, however a missing condition was allowing that timeout to apply to all jobs, not just SchedulerJobs. This is because polymorphic identity isn't included for `update()`: https://docs.sqlalchemy.org/en/13/orm/query.html#sqlalchemy.orm.query.Query.update So if we had any running LocalTaskJobs that, for whatever reason, aren't heartbeating faster than `scheduler_health_check_threshold`, their state gets set to failed and they subsequently exit with a log line similar to: State of this instance has been externally set to scheduled. Terminating instance. Note that the state it is set to can be different (e.g. queued or up_for_retry) simply depending on how quickly the scheduler has progressed that task_instance again. (cherry picked from commit 38d329b)
- Loading branch information