symfonic.services.switching.admission¶
admission ¶
Atomic bind-and-register admission (CUT-SS-4, CUT-AIR-2, SCP-FRZ-1).
Binding and registering are one operation. Split them and there is a window in which an invocation holds a generation nothing knows about — which is exactly the window a drain proof would miss, and exactly the invocation that would keep running after a freeze said stop.
AdmissionController ¶
AdmissionController(*, source: Any, registry: ActiveInvocationRegistry | None = None, worker_id: str = 'worker', barrier: QuiescenceBarrier | None = None, clock: Callable[[], float] = time.time)
Binds a generation and registers the invocation under one lock.
Source code in src/symfonic/services/switching/admission.py
acknowledge_freeze
async
¶
CUT-BR-6 — this worker states that it has observed the freeze.
Source code in src/symfonic/services/switching/admission.py
admit
async
¶
admit(*, invocation_id: str, bundle_id: str, tenant_scope_hash: str, inherited_pin: InvocationPin | None = None) -> BoundGeneration
Resolve one snapshot and register it, atomically against the freeze.
Source code in src/symfonic/services/switching/admission.py
resume
async
¶
resume(pin: InvocationPin | None, *, invocation_id: str, tenant_scope_hash: str = '') -> BoundGeneration
Resume under the artifact's pin, not under this worker's binding.
Source code in src/symfonic/services/switching/admission.py
BoundGeneration
dataclass
¶
What one invocation captured: a pin, its binding, and its registry row.
record is None in library mode: CUT-AIR-5 makes the registry
operated-platform-only, and a library adopter must not find themselves
maintaining a drain-proof table they have no control plane to drain for.