feat(mesh): give boot a grace period for a slow teapot, and fail for an absent one #49

Closed
chrnx wants to merge 1 commits from feat/mesh-boot-retry into feat/mesh-envelope
pull from: feat/mesh-boot-retry
Owner

Rama B del plan de mesh, apilada sobre #48 — mergea esa primero y esta reapunta a develop.

bootTimeoutMs (default timeoutMs) retries a teapot that has not finished starting. When it passes the boot still fails: a provider the graph depends on is not optional, and booting without it only moves the failure to the first request, where it is a caller's 503 rather than the deploy's error. 0 restores a single attempt.

The full battery caught what the first cut got wrong: a bad secret was being retried. That is the teapot's decision, not the network's, and it will be the same decision in 30s — so refusals now fail immediately. Told apart by whether the socket ever opened, which avoids threading close codes through the neutral socket contract of four runtimes.

Retries are logged and emitted as the new mesh:boot:retry, kept separate from mesh:disconnect — that one is a link that was up and went away, this one never came up.

437 vitest / 12 Deno / 7 Bun / edge / JSR dry run. Docs companion: green-tea-docs#3.

Rama B del plan de mesh, **apilada sobre #48** — mergea esa primero y esta reapunta a `develop`. `bootTimeoutMs` (default `timeoutMs`) retries a teapot that has not finished starting. When it passes the boot **still fails**: a provider the graph depends on is not optional, and booting without it only moves the failure to the first request, where it is a caller's 503 rather than the deploy's error. `0` restores a single attempt. **The full battery caught what the first cut got wrong:** a bad secret was being retried. That is the teapot's decision, not the network's, and it will be the same decision in 30s — so refusals now fail immediately. Told apart by whether the socket ever *opened*, which avoids threading close codes through the neutral socket contract of four runtimes. Retries are logged **and** emitted as the new `mesh:boot:retry`, kept separate from `mesh:disconnect` — that one is a link that was up and went away, this one never came up. 437 vitest / 12 Deno / 7 Bun / edge / JSR dry run. Docs companion: green-tea-docs#3.
chrnx added 1 commit 2026-08-18 16:50:49 +00:00
feat(mesh): give boot a grace period for a slow teapot, and fail for an absent one
CI / dco (pull_request) Successful in 4s
CI / build (pull_request) Successful in 24s
CI / runtimes (deno) (pull_request) Successful in 18s
CI / runtimes (edge) (pull_request) Successful in 13s
CI / runtimes (bun) (pull_request) Successful in 16m11s
1975a7c03f
A teapot that is thirty seconds behind and a teapot that does not exist look
identical for the first thirty seconds, and only one of them should stop a
deploy. bootTimeoutMs is that grace: retries with backoff until it passes.

It still fails after that, deliberately. A provider the graph depends on is
not optional, and booting without it would only move the failure to the first
request, where it is a caller's 503 rather than the deploy's error.

The full battery caught what the first cut got wrong: a bad secret was being
retried. That is not a transient failure — it is the teapot's decision, and it
will be the same decision in thirty seconds, so retrying only spends the
deploy's patience to arrive at the identical error. Refusals now fail at once.

Telling them apart without threading close codes through the neutral socket
contract of four runtimes: a peer that accepted the connection and then hung
up before answering rejected us on purpose; one that never accepted it may
simply not be listening yet. That is exactly the distinction needed here.

Retries are logged and emitted as mesh:boot:retry, kept separate from
mesh:disconnect — that one is a link that was up and went away, this one never
came up, and a deploy watching for trouble wants to tell those apart.

437 vitest / 12 Deno / 7 Bun / edge / JSR dry run.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
chrnx closed this pull request 2026-08-18 18:01:38 +00:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.