exlab_wizard.sync.transports#
Sync transports package. Backend Spec §7.1.3.
Each transport is a thin async wrapper around an upstream binary. They
share a small common shape (TransportResult, TransportErrorKind)
so the queue worker can treat outcomes uniformly while logging the raw
stdout/stderr for diagnostics.
Classes
|
Kind of failure that the queue worker uses to drive the retry policy. |
|
Outcome of a transport push. |
Exceptions
|
Raised when a transport probe cannot complete. |
- exception exlab_wizard.sync.transports.TransportError(message, *, error_kind=None)[source]#
Bases:
ExceptionRaised when a transport probe cannot complete.
Distinct from
TransportResult: this surfaces conditions where the transport’s hashsum-style probe could not produce a manifest at all – either because the upstream binary is missing (error_kind=Nonefor the historical “binary not on PATH” case) or because the probe ran and failed in a classifiable way (AUTH, NETWORK, UNKNOWN). The queue worker useserror_kindto route the failure through the §7.1.5 retry policy:AUTH– terminal FAILED, no retry (configuration problem).NETWORK– non-terminal failure, exponential backoff retry.UNKNOWN– treated asNETWORKfor retry purposes.None– legacy “binary missing” callers. Routed through the §7.1.5 HASH_MISMATCH branch: one immediate retry, then terminal FAILED on the second occurrence. The operator surfaces the binary-missing reason vialast_error.
- Parameters:
message (
str)error_kind (
TransportErrorKind|None)
- class exlab_wizard.sync.transports.TransportErrorKind(*values)[source]#
Bases:
StrEnumKind of failure that the queue worker uses to drive the retry policy.
Backend Spec §7.1.5.
NETWORK: timeout, ECONNRESET, transient SSH failure – retried with exponential backoff up toMAX_ATTEMPTS.AUTH: authentication failure – terminal FAILED, no retry.HASH_MISMATCH: post-transport hash check failed – single retry of the transport phase, then terminal.LOCAL_FILE_VANISHED: the local file disappeared between transport and verify – terminal FAILED withlocal_file_vanishedreason.UNKNOWN: catch-all for transports returning a non-zero code we don’t recognize – treated asNETWORKfor retry purposes.
- AUTH = 'auth'#
- HASH_MISMATCH = 'hash_mismatch'#
- LOCAL_FILE_VANISHED = 'local_file_vanished'#
- NETWORK = 'network'#
- UNKNOWN = 'unknown'#
- class exlab_wizard.sync.transports.TransportResult(ok, error_kind=None, stderr='', stdout='', returncode=0)[source]#
Bases:
objectOutcome of a transport push.
okis True iff the transport reported success. On failure,error_kindselects the retry path;stderris the raw stderr text for log surfacing;returncodeis the subprocess exit code.- Parameters:
- error_kind: TransportErrorKind | None#
Modules