ExSandbox.Conformance.Reachability (ExSandbox v1.0.1)

Copy Markdown View Source

Conformance group: the states a request to a sandbox can land in (003 T021, FR-022FR-024, quickstart Scenario 5).

Six outcomes, and why none may collapse

006-domain-routing is the consumer of this. When a request arrives for a sandbox that is not serving, it has to choose between three different actions — start it on demand, wait, or report a fault — and the choice is made entirely from what status/1 said.

StateWhat 006 does
:runningproxy the request
:stoppedstart on demand, then proxy
:provisionedstill being built — wait, do not start
:startinga start is already in flight — wait, do not start a second
:unknownreport a fault; do not act on a guess
:absent404 — there is nothing to start

Any two of those collapsing produces a wrong action, not a vaguer one:

  • :stopped collapsed into :provisioned means a stopped sandbox is never started, and the request hangs until it times out.
  • :starting collapsed into :stopped means every concurrent request launches its own start — the double-provision of FR-010, arriving one layer up.
  • :absent collapsed into :unknown turns a definite 404 into a retry loop against a sandbox that will never exist.

The caller cannot recover information the callee discarded. That is the whole reason this is a conformance check rather than a documentation note: a mechanism reporting {:ok, :unknown} for everything satisfies the type on every call, and every check that merely pattern-matches the shape passes it.

:starting is a state, not a flag

FR-024 names it explicitly. A boolean starting? alongside :stopped would encode the same information and is the shape that tends to get written, because "starting" feels like a modifier on "not running". It is not: a sandbox that is starting must not be started again, and a sandbox that is stopped must be — opposite actions, so they are different states.

Summary

Functions

Emits the reachability checks into the calling test module.

Functions

tests()

(macro)

Emits the reachability checks into the calling test module.