Skip to content

perf(secrets): parallelize provider fan-out and header resolution#276

Merged
RhysSullivan merged 1 commit intomainfrom
rs/secrets-parallel-fanout
Apr 17, 2026
Merged

perf(secrets): parallelize provider fan-out and header resolution#276
RhysSullivan merged 1 commit intomainfrom
rs/secrets-parallel-fanout

Conversation

@RhysSullivan
Copy link
Copy Markdown
Owner

Several per-request hot paths iterated secret providers with sequential
yield*, turning a fan-out into N round-trips. Fix by switching to
Effect.all(..., { concurrency: 'unbounded' }).

  • executor.ts secretsGet fallback: when the core routing-table misses,
    ask every enumerating provider in parallel; first non-null in
    registration order wins. Providers that throw are still treated as
    'don't have it'.

  • executor.ts secretsRemove: delete across every writable provider in
    parallel. Providers don't coordinate on ownership — each gets asked,
    and most calls are no-ops.

  • executor.ts secretsList: provider.list() runs in parallel, then the
    results are merged in registration order so 'first provider wins'
    precedence remains deterministic.

  • openapi/invoke.ts + graphql/invoke.ts resolveHeaders: resolve
    secret-backed headers in parallel. OpenAPI fails the invocation on
    any missing secret (unchanged semantics); GraphQL drops the header
    silently on failure (unchanged semantics).

N is small (3-5 providers, 1-5 headers) so parallelism is unbounded;
no Effect.all concurrency cap needed.

Several per-request hot paths iterated secret providers with sequential
yield*, turning a fan-out into N round-trips. Fix by switching to
Effect.all(..., { concurrency: 'unbounded' }).

- executor.ts secretsGet fallback: when the core routing-table misses,
  ask every enumerating provider in parallel; first non-null in
  registration order wins. Providers that throw are still treated as
  'don't have it'.

- executor.ts secretsRemove: delete across every writable provider in
  parallel. Providers don't coordinate on ownership — each gets asked,
  and most calls are no-ops.

- executor.ts secretsList: provider.list() runs in parallel, then the
  results are merged in registration order so 'first provider wins'
  precedence remains deterministic.

- openapi/invoke.ts + graphql/invoke.ts resolveHeaders: resolve
  secret-backed headers in parallel. OpenAPI fails the invocation on
  any missing secret (unchanged semantics); GraphQL drops the header
  silently on failure (unchanged semantics).

N is small (3-5 providers, 1-5 headers) so parallelism is unbounded;
no Effect.all concurrency cap needed.
@RhysSullivan RhysSullivan merged commit 36ef838 into main Apr 17, 2026
5 checks passed
@RhysSullivan RhysSullivan deleted the rs/secrets-parallel-fanout branch April 17, 2026 19:03
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.

1 participant