Skip to content

feat(mesh): connect teapots in parallel at boot - #112

Merged
chrnx-dev merged 1 commit into
developfrom
feat/mesh-parallel-boot-connect
Nov 30, 2026
Merged

chrnx-dev merged 1 commit into
developfrom
feat/mesh-parallel-boot-connect

Conversation

@chrnx-dev

Copy link
Copy Markdown
Contributor

Closes #95.

Teapots connected one after another, so N absent teapots held the boot for N × bootTimeoutMs. Now every connect starts at once (Promise.all) and the results register in config order, so the graph does not depend on arrival order.

  • A permanent refusal (wrong secret) still fails the boot immediately. Connects still in flight close their link when it lands, so nothing leaks.
  • No API change: only spliceRemoteScopes in src/app/index.ts (D19 scope respected).

Tests

  • Node: three absent teapots boot in < 1.5s with a 600ms budget (1.8s before); a refusal next to an absent teapot fails in < 3s (30s before). Both fail on develop.
  • Deno and Bun: the three-absent-teapots case in mesh-reconnect.test.ts.

Verified locally

lint (0 errors), format, complexity, typecheck, coverage, build, api:check, test:deno (70), test:bun (60), test:edge.

Benchmark: boot path only; the request hot path is untouched, so no throughput bench was run. The boot timings above are the measurement.

N absent teapots cost N x bootTimeoutMs because each connect was awaited before
the next began. Start every connect at once and register the results in config
order, so the graph stays deterministic. A permanent refusal still fails the
boot immediately; connects still in flight close their link when it lands.

Tests: three absent teapots boot in about one budget on Node, Deno and Bun
(1.8s before, ~0.6s after), and a refusal next to an absent teapot fails in
under 3s (30s before).

Closes #95

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mesh: connect teapots in parallel at boot

1 participant