ReviewOS

home-lang/home

Model gRPC local subchannel pool ownership

#240
Closed chris opened this 10 days ago ·
10 days ago

Scope

Port Bun corpus position 3982, js/third_party/grpc-js/test-local-subchannel-pool.test.ts, with the actual grpc.use_local_subchannel_pool ownership contract instead of treating the option as inert.

Required contracts

  • local-pool clients acquire distinct subchannel records even for the same target
  • global-pool clients share a target record and maintain reference counts
  • closing one client cannot invalidate another client's pooled transport
  • close is idempotent and releases the record exactly once
  • invalid pool lifecycle operations retain causes and actionable pool/target stack context

Verification

  • focused upstream file passes without unsupported cases
  • permanent diagnostics distinguish local and global ownership
  • existing gRPC, SQL adapter, and third-party gates remain green
10 days ago

Implemented and pushed in 41dd0e57e.

Completed contracts:

  • grpc.use_local_subchannel_pool: 1 allocates isolated per-client subchannel records
  • global-pool clients share target-scoped records with explicit reference counts
  • closing one global client preserves the shared record for remaining clients
  • close is idempotent and final release retires the record
  • impossible/double-release invariants produce ERR_GRPC_SUBCHANNEL_POOL with a preserved cause and SubchannelPool.release, target, and source-module stack context

Verification:

  • focused Bun corpus: 1 passed, 0 failed, 0 todo, 0 unsupported
  • permanent gRPC diagnostics: 9 passed
  • SQL adapter contracts: passed
  • permanent third-party JWT/utility mini-suite: passed
  • zig fmt --check and git diff --check: passed

Cumulative through position 3982: 324 files, 2,662 passed, 209 todo, 0 failed, 0 unsupported, 171 allowed-empty.

Sign in to comment on this issue.