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
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ async def fetch(self, limit: int) -> list[JobRunningPipelineItem]:
JobModel.status.in_(
[JobStatus.PROVISIONING, JobStatus.PULLING, JobStatus.RUNNING]
),
RunModel.status.not_in([RunStatus.TERMINATING]),
or_(
# Process provisioning and pulling jobs quicker for low-latency provisioning.
# Active jobs processing can be less frequent to minimize contention with `RunPipeline`.
Expand All @@ -223,10 +222,11 @@ async def fetch(self, limit: int) -> list[JobRunningPipelineItem]:
),
or_(
and_(
# Do not try to lock jobs if the run is waiting for the lock,
# Do not try to lock jobs if the run is waiting for the lock or terminating,
# but allow retrying jobs whose own lock is stale because
# the run pipeline cannot reclaim stale job locks.
RunModel.lock_owner.is_(None),
RunModel.status.not_in([RunStatus.TERMINATING]),
JobModel.lock_expires_at.is_(None),
),
JobModel.lock_expires_at < now,
Expand Down
Loading