sched: gate scheduled resumes on the shared execution slot, with drain tracking (B2)
This commit is contained in:
@@ -190,11 +190,19 @@ class Scheduler:
|
||||
return admission.schedule_id
|
||||
|
||||
def _task_load(self) -> int:
|
||||
from wf_scheduling.recovery import _is_pending
|
||||
from wf_scheduling.recovery import _is_pending, is_executing
|
||||
|
||||
count = 0
|
||||
for run in self.run_store.list_runs():
|
||||
if self._status_value(run) != "admitted":
|
||||
# A mid-resume scheduled run is interrupted but holds the
|
||||
# durable executing mark: it occupies a live execution
|
||||
# slot exactly like a dispatched run (B2), so the shared
|
||||
# capacity gate must count it.
|
||||
if is_executing(self.run_store, run.id) and not _is_pending(
|
||||
self.run_store, run.id
|
||||
):
|
||||
count += 1
|
||||
continue
|
||||
if _is_pending(self.run_store, run.id):
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user