← Về thư mục
openai4s/orchestration/reconciler.py
- WorkloadStore · class · L74-L102 — class WorkloadStore(Protocol)
- workloads_needing_attention · method · L82-L82 — def workloads_needing_attention(self) -> list[Workload]
- get_workload · method · L84-L84 — def get_workload(self, workload_id: str) -> Workload | None
- active_allocation · method · L86-L86 — def active_allocation(self, workload_id: str) -> Allocation | None
- get_allocation · method · L88-L88 — def get_allocation(self, allocation_id: str) -> Allocation | None
- create_allocation · method · L90-L90 — def create_allocation(self, workload_id: str, epoch: int) -> Allocation
- save_allocation · method · L92-L92 — def save_allocation(self, allocation: Allocation) -> None
- save_workload · method · L94-L94 — def save_workload(self, workload: Workload) -> None
- save_allocation_and_workload · method · L96-L98 — def save_allocation_and_workload( self, allocation: Allocation, workload: Workload ) -> None
- open_recovery_epoch · method · L100-L102 — def open_recovery_epoch( self, allocation: Allocation, workload: Workload ) -> None
- TickReport · class · L106-L119 — class TickReport
- post_init · method · L117-L119 — def post_init(self) -> None
- Reconciler · class · L122-L803 — class Reconciler
- init · method · L125-L167 — def init( self, *, store: WorkloadStore, backends: dict[str, AllocationBackend], default_backend: str = "local", profile_for: Callable[[Workload], ResourceProfile] | None = None, prepare_attempt: Callable[[Workload, Allocation], WorkloadSpec] | None = None, max_recoveries: int = DEFAULT_MAX_RECOVERIES, on_state_lost: Callable[[Workload, Allocation], None] | None = None, interval_s: float = DEFAULT_INTERVAL_S, clock: Callable[[], float] = time.monotonic, on_event: Callable[[str, dict], None] | None = None, ) -> None
- running · method · L171-L174 — def running(self) -> bool
- start · method · L176-L189 — def start(self) -> None: #
running() rather than _thread is not None: a loop that exited on # its own leaves the attribute set, and treating that as "already # started" means it can never be restarted — the daemon goes quiet # and every later submission waits forever for a tick that will not # come.
- stop · method · L191-L204 — def stop(self, *, timeout_s: float = 5.0) -> None
- _run · method · L206-L225 — def _run(self) -> None
- tick · method · L229-L252 — def tick(self) -> TickReport
- _acknowledge_durable_terminals · method · L254-L291 — def _acknowledge_durable_terminals(self, report: TickReport | None = None) -> None
- _terminal_ack_error · method · L293-L315 — def _terminal_ack_error( self, backend_name: str, allocation_id: str | None, exc: BaseException, report: TickReport | None, ) -> None
- _backend_for · method · L317-L322 — def _backend_for(self, workload: Workload) -> AllocationBackend
- _reconcile_one · method · L324-L370 — def _reconcile_one(self, workload: Workload, report: TickReport) -> None
- _submit_new · method · L374-L418 — def _submit_new( self, workload: Workload, backend: AllocationBackend, report: TickReport ) -> None
- _reconcile_unknown · method · L420-L477 — def _reconcile_unknown( self, workload: Workload, allocation: Allocation, backend: AllocationBackend, report: TickReport, ) -> None
- _advance · method · L479-L538 — def _advance( self, workload: Workload, allocation: Allocation, backend: AllocationBackend, report: TickReport, ) -> None
- _recover_session · method · L540-L612 — def _recover_session( self, workload: Workload, allocation: Allocation, observed: Observation, report: TickReport, ) -> bool
- _cancel_barrier · method · L616-L771 — def _cancel_barrier( self, workload: Workload, allocation: Allocation | None, backend: AllocationBackend, *, reason: Reason, report: TickReport, ) -> None
- _fail · method · L775-L797 — def _fail( self, workload: Workload, reason: Reason, report: TickReport, *, allocation: Allocation | None = None, ) -> None
- _emit · method · L799-L803 — def _emit(self, kind: str, payload: dict) -> None
- _store_is_gone · function · L806-L813 — def _store_is_gone(exc: BaseException) -> bool