Skip to content

feat(origin): setup http transport config and connection pool#629

Draft
sambhav-jain-16 wants to merge 1 commit into
uber:masterfrom
sambhav-jain-16:transport-setup
Draft

feat(origin): setup http transport config and connection pool#629
sambhav-jain-16 wants to merge 1 commit into
uber:masterfrom
sambhav-jain-16:transport-setup

Conversation

@sambhav-jain-16
Copy link
Copy Markdown
Collaborator

What?

This PR aims to establish the base code for configuring connection pool configs using http.Transport. These changes are not currently wired up to the actual production code and will be done in a follow-up PR

Why?

To reduce sudden bursts of new connections during a bursty load and to avoid overwhelming the host's listen queue, a connection pool is needed. We are starting with the replication logic b/w origin-origin first.

Testing?

A benchmark will be included in the next PR when the code is wired by replication handlers

Copilot AI review requested due to automatic review settings May 29, 2026 12:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Introduces a shared *http.Transport builder with YAML-configurable connection pool sizing in utils/httputil, and threads an optional shared http.RoundTripper through the origin blob client (and its chunked upload helpers) via a new WithTransport option and a sendOpt helper that selects between SendTLS, SendTransport, and SendTLSTransport. The new transport is not yet wired into production startup, as called out in the description.

Changes:

  • Add httputil.ConnPoolConfig + NewClientTransport with sensible defaults (256 idle / 32 per host).
  • Add blobclient.WithTransport and a sendOpt helper; replace all httputil.SendTLS(c.tls) call sites in HTTPClient with sendOpt(c.tls, c.transport).
  • Propagate the shared transport into transferClient and uploadClient constructors and their start/patch/commit requests.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
utils/httputil/transport.go New ConnPoolConfig and NewClientTransport factory for a shareable, pooled HTTP transport.
origin/blobclient/client.go Adds transport field, WithTransport option, and sendOpt helper; routes all request sites through it.
origin/blobclient/uploader.go Adds transport to transferClient/uploadClient and their constructors; propagates it into chunked upload requests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants