sched: remediate R4 ownership, identity-match, dispatch-mark, and pending atomicity
This commit is contained in:
@@ -310,8 +310,21 @@ class Scheduler:
|
||||
self.schedule_store.save_consumed(sched.id, intended)
|
||||
from wf_api.run_lifecycle import materialize_admitted_view
|
||||
|
||||
# Dispatch mark precedes the view so a crash after admission but
|
||||
# before/during first dispatch stays pending (not abandoned). Cleared
|
||||
# after dispatch returns regardless of outcome (hang still dispatched).
|
||||
try:
|
||||
self.run_store.mark_pending_dispatch(run_id)
|
||||
except AttributeError:
|
||||
pass
|
||||
materialize_admitted_view(store=self.run_store, admission=admission)
|
||||
self._dispatch(run_id, now)
|
||||
try:
|
||||
self._dispatch(run_id, now)
|
||||
finally:
|
||||
try:
|
||||
self.run_store.clear_pending_dispatch(run_id)
|
||||
except AttributeError:
|
||||
pass
|
||||
return run_id
|
||||
|
||||
def _dispatch(self, run_id: str, now: datetime) -> None:
|
||||
|
||||
Reference in New Issue
Block a user