Skip to content

Create a per-org shared connection for graphql requests - #300

Open
hosom wants to merge 2 commits into
mainfrom
reuse-graphql-http
Open

Create a per-org shared connection for graphql requests#300
hosom wants to merge 2 commits into
mainfrom
reuse-graphql-http

Conversation

@hosom

@hosom hosom commented Aug 28, 2026

Copy link
Copy Markdown

When we make graphql requests at the moment, every single request spawns a new http object and pays for it in a full tcp and tls handshake.

My suggestion is that we create a single connection per-org and speed things up a little.

It's hard to say what the practical improvement will be with the cache in the loop, but on a cold start this could actually shave a minute or more of deploy time.

Copilot AI balanced review requested due to automatic review settings August 28, 2026 21:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

Review tier: Balanced
Findings: 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity lib/​entitlements/​service/​github.rb — This cache is scoped to a service instance, not to an organization. GitHubOrg::Provider and…
What changed in this PR

Introduces persistent GraphQL HTTP connections to reduce repeated TCP/TLS handshakes.

Changes:

  • Reuses started Net::HTTP connections.
  • Resets failed connections.
  • Adds reuse and failure-path tests.
File Description
lib/​entitlements/​service/​github.rb Adds persistent connection management.
spec/​unit/​entitlements/​service/​github_spec.rb Tests connection reuse and recovery.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/entitlements/service/github.rb
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.

3 participants