Skip to content

F22.7 — HTTP policy with bounded readiness

State Closed
Parent E22
Iteration Release 9
Start Date 2026-11-14
Closed Date 2026-11-16
Predecessors F22.3

Stories: 3 Closed

Story State Depends on
S22.7.1 — Decide synchronous check lifetime Closed (2026-11-14) —
S22.7.2 — Implement bounded reporting Closed (2026-11-14) S22.7.1
S22.7.3 — Organize shared HTTP cases Closed (2026-11-16) —

Keep wire policy in web, make readiness deadlines truthful, and organize conformance by subject.

Context

health.py:230-239 waits on futures inside a ThreadPoolExecutor context: leaving the context waits for unfinished work, so a timeout cannot bound reporting latency. Sequential relative waits also give checks different effective deadlines. conformance/cases.py holds 1,890 lines across multiple HTTP concerns.

S22.7.1 — Decide synchronous check lifetime

State: Closed (2026-11-14)

Reproduce timeout behavior with event-blocked checks. Settle deadline origin, concurrency bounds, ownership and shutdown for checks that Python cannot forcibly stop. Avoid solving latency by spawning unlimited abandoned workers.

Acceptance:

  • A decision records common-deadline semantics and a bounded worker/reuse policy, with explicit behavior for stuck checks and shutdown.
  • No claim is made that timing out a synchronous callable cancels its execution.
  • Settled (owner, 2026-11-14): option A, a shared bounded pool.
    • run_checks_sync runs checks on one process-wide pool of at most 32 workers. It never shuts the pool down and never waits on a worker after the deadline.
    • The deadline is time.monotonic() + timeout, computed once per call; every wait gets only the time remaining.
    • A slot is held until the callable actually returns. When no slot is free, the check is not queued: it fails at once with the reason not run: health check capacity exhausted.
    • A timed-out check keeps running and keeps its slot. Permanently stuck checks can exhaust the pool, and the interpreter waits for them at exit.
    • timeout=None still waits indefinitely. The async run_checks path is unchanged.

Outcome: strict-xfail reproductions in packages/rn-forge-web/tests/test_health.py.

S22.7.2 — Implement bounded reporting

State: Closed (2026-11-14) · Depends on: S22.7.1

Apply the decision without waiting for an unfinished worker on the response path. Exercise direct web calls and Django readiness.

Acceptance:

  • A readiness call reports required/optional failures before a blocked check is released; tests release workers in cleanup.
  • Several slow checks share the documented deadline rather than receiving serial timeout budgets.
  • Repeated timeouts do not grow workers/queued checks without bound; async and sync aggregation retain their intended contract.

Outcome: Django readiness is exercised through health_urlpatterns, which owns the timeout; readiness_view's signature is unchanged.

S22.7.3 — Organize shared HTTP cases

State: Closed (2026-11-16)

Split conformance definitions by HTTP subject behind their existing public surface. Keep request/response hashing, pagination and problem rendering policy framework-free; adapters should consume it instead of re-deriving it.

Acceptance:

  • All existing case IDs and their behavioral expectations remain addressable and framework adapter conformance still runs.
  • No framework dependency enters web, and test-support extraction does not add runtime imports.
  • Transfer buffering measurements identify actual duplication before proposing a shared codec change.

Settled contract: the 118 conformance cases live in five private subject modules (_problem, _writes, _pagination, _transfer, _platform, plus _shared); CASES is their concatenation in that order, so global order may differ from before while each cases_for(area) order, every (area, id) and every depends_on (resolved by case_by_id) is unchanged; the public __all__ lists are unchanged; no shared transfer codec, because no codec step is duplicated between the adapters.

Outcome: cases.py fell from about 1,900 lines to 60; a layout test pins the IDs, per-area order, partition and policy-only imports.

Acceptance

  • S22.7.1: A decision records common-deadline semantics and a bounded worker/reuse policy, with explicit behavior for stuck checks and shutdown.
  • S22.7.2: A readiness call reports required/optional failures before a blocked check is released; tests release workers in cleanup.
  • S22.7.3: All existing case IDs and their behavioral expectations remain addressable and framework adapter conformance still runs.