Skip to content

uploader: add opt-in persistent HTTP connections - #307

Open
tonyredondo wants to merge 2 commits into
mainfrom
feat/uploader-http-keepalive
Open

tonyredondo wants to merge 2 commits into
mainfrom
feat/uploader-http-keepalive

Conversation

@tonyredondo

@tonyredondo tonyredondo commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

The uploader currently opens a connection for every request. This adds optional connection reuse so consumers can compare that cost on their own intake and proxy routes. It stays off by default and is independent of test-payload batching.

Enable it with http_keep_alive = True on dd_payload_uploader, or set DD_TEST_OPTIMIZATION_HTTP_KEEP_ALIVE=1 at runtime. Setting the variable to 0 restores the default transport. The Python uploader owns at most one connection per worker and closes it when the origin, proxy or tunnel changes, on incomplete responses or transport errors, and when the worker pool exits. Legacy Bash and PowerShell uploaders reject an enabled setting.

TLS verification, proxy bypass, credentials, request bodies and the explicit retry budget retain their existing policy. A stale connection can fail after a POST reached the server; recovery uses that same retry budget and prepared body. Connection reuse adds no hidden reconnect retry or exactly-once guarantee.

Validation:

  • All 35 current checks pass at d411d08d, including CodeQL. The CI jobs checked out merge revision 315d3eba, which contains this head and main@95cf545a.
  • 679 native Python tests passed (one skipped), including 33 transport tests. Coverage includes real TLS and authenticated CONNECT, proxy bypass and route isolation, stale connections, retry limits, multipart and gzip byte preservation, agentless/EVP headers, credential-safe redirects, malformed or truncated responses, and worker cleanup.
  • Both consumer frontends passed the paired local E2E: the same four ZIP-backed requests carried the same 12 expected test events with unchanged body sizes and source hashes, using four accepted connections with reuse disabled and one with it enabled.
  • The local Bazel tools run passed 206 of 207 targets. Its Python harness hit a PowerShell/.NET startup failure that also reproduces on unchanged main; the full Python suite passes outside Bazel. The current hosted CI passes on Linux, macOS and Windows; Linux and macOS run all 207 tools targets, and Windows passes its 206 supported targets with one expected skip.
  • The Bash and PowerShell integration harnesses passed on macOS. The Bash harness used the installed Bash 5.3; the stock Bash 3.2 stops on an existing empty-array expansion before reaching the uploader. The current Windows CI also passes.
  • Template lint, Starlark formatting, module-version alignment, the offline release-bundle preview and git diff --check passed.

A small loopback TLS comparison held 64 requests and 1,050,240 body bytes fixed and reduced accepted connections from 64 to one. It establishes reuse, not a throughput improvement for a real consumer. The paired E2E PR adds this comparison to the existing Linux WORKSPACE and Bzlmod jobs; there is no new job matrix.

Paired consumer coverage: rules_test_optimization_tests #194.

@tonyredondo
tonyredondo marked this pull request as ready for review November 14, 2026 07:47
@tonyredondo
tonyredondo requested a review from a team as a code owner November 14, 2026 07:47

@datadog-official datadog-official Bot 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.

Bits Code Review: PASS

More details

The completed static review found no reportable defect in the opt-in transport, including route isolation, retry limits, response handling, and worker cleanup.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit d411d08

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