sched: sibling-distinct lock identity; reject shared-store overlaps (R4 wave 4)
This commit is contained in:
@@ -31,7 +31,11 @@ from wf_scheduling.history import (
|
||||
HistoryRecorder,
|
||||
)
|
||||
from wf_scheduling.models import PendingCandidate
|
||||
from wf_scheduling.ownership import SchedulerOwnership, SecondOwnerError
|
||||
from wf_scheduling.ownership import (
|
||||
SchedulerOwnership,
|
||||
SecondOwnerError,
|
||||
describe_unsupported_layout,
|
||||
)
|
||||
from wf_scheduling.prepare import InvocationPreparer, PreparationRejected
|
||||
|
||||
UTC = timezone.utc
|
||||
@@ -146,10 +150,12 @@ class Scheduler:
|
||||
or administering schedules would risk double admission.
|
||||
"""
|
||||
ownership = self.ownership
|
||||
if ownership is None or not ownership.covers(
|
||||
getattr(self.schedule_store, "root", None),
|
||||
getattr(self.run_store, "root", None),
|
||||
):
|
||||
sched_root = getattr(self.schedule_store, "root", None)
|
||||
runs_root = getattr(self.run_store, "root", None)
|
||||
unsupported = describe_unsupported_layout(sched_root, runs_root)
|
||||
if unsupported is not None:
|
||||
raise SecondOwnerError(unsupported)
|
||||
if ownership is None or not ownership.covers(sched_root, runs_root):
|
||||
raise SecondOwnerError(
|
||||
"scheduler ownership must cover the schedule and run stores "
|
||||
"before polling or mutating schedules"
|
||||
|
||||
Reference in New Issue
Block a user