Share connections between stubs for the same target - #10
Merged
samuel-williams-shopify merged 4 commits intoSep 24, 2026
Merged
Conversation
Stubs constructed without a channel override now share one client per thread for the same URL and TLS configuration, similar to grpc-core's global subchannel pool. TLS configurations are copied and compared by value, and cache keys contain a digest rather than private keys. Closing a stub leaves shared clients open; `SharedChannel.close` closes the current thread's clients, and `grpc.use_local_subchannel_pool` gives a stub its own client. Fixes socketry#8. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
samuel-williams-shopify
force-pushed
the
ek-conductor/fix-issue-8
branch
from
September 24, 2026 23:14
06bce89 to
77b9322
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stubs and GAPIC adapters constructed without a channel override now share one
Async::GRPC::Clientper thread for the same target URL and TLS configuration, similar to grpc-core's global subchannel pool, so building a client per request or job reuses warm connections within a reactor. TLS configurations are copied, frozen, and compared by value using io-endpoint 0.19.0. Cache keys use the configuration directly, so different trust roots, client certificates, or verification policies never share a connection. Configuration inspection redacts private keys. Closing a stub leaves shared clients open;SharedChannel.closecloses the current thread's shared clients, and grpc'sgrpc.use_local_subchannel_poolchannel argument gives a stub its own client (which is also whereClientStub.endpoint_foroverrides now apply). Fixes #8.Validation against published io-endpoint 0.19.0 on Ruby 4.0.7: 139 tests, 486 assertions, 100% line coverage,
bundle exec rubocop, andbake decode:index:coverage lib(36/36). Includes connection reuse, mutation isolation, and private-key redaction.🤖 Generated with Claude Code