Make HTTP/2 channel creation timeout configurable#1162
Merged
shivamgupta1 merged 7 commits intoJun 4, 2026
Merged
Conversation
TylerHorth
reviewed
Apr 10, 2026
The HTTP/2 parent channel creation timeout was hardcoded at 10,000ms (with a TODO to expose via cfg2). When a downstream host becomes unreachable, all concurrent requests to that host queue behind the parent channel bootstrap and block for the full 10s timeout before failing — destroying p95 latency for callers. This change threads a configurable channelCreationTimeoutMs through: HttpClientFactory.Builder → ChannelPoolManagerFactoryImpl → Http2ChannelPoolFactory → Http2ChannelLifecycle Services can now tune this via HttpClientFactory.Builder .setHttp2ChannelCreationTimeout(3000) to fail faster and let D2's degrader remove flaky hosts sooner. Default remains 10,000ms for backwards compatibility. All existing constructors are preserved as @deprecated overloads. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Constructor A (without udsAddress) keeps delegating to Constructor B (with udsAddress=null) as before — B now delegates to C with the default timeout, so changing A's delegation was redundant. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Http2ChannelLifecycle has package-private visibility so it cannot be imported from HttpClientFactory or ChannelPoolManagerFactoryImpl which are in different packages. Define the default value (10000ms) directly in HttpClientFactory and reference it from ChannelPoolManagerFactoryImpl. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The multipart-mime module has flaky tests (TestMIMEReaderDrain) that are unrelated to most PRs and cause spurious CI failures. Adding it to CONDITIONAL_TESTING_MODULES ensures its tests are only run when its dependencies (r2-core, data) are actually touched.
This reverts commit e4e1ed1.
kt2205
force-pushed
the
kt2205/configurable-http2-channel-creation-timeout
branch
from
June 1, 2026 06:21
ecb92b4 to
a0a84ff
Compare
Contributor
Author
CI Failure AnalysisThe
|
Record the new configurable channel creation timeout under the Unreleased heading, per the Pegasus Git Workflow.
Bump gradle.properties to 29.85.13 (patch) and run ./scripts/update-changelog to move the HTTP/2 timeout entry under the new version heading. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Usage
Backwards Compatibility
Motivation
In production, a single flaky host that fails SSL handshakes intermittently causes the 10s hardcoded timeout to block all concurrent HTTP/2 requests to that host (due to the parent channel bootstrapping pattern in Http2ChannelLifecycle). A lower configurable timeout (e.g. 3s) allows D2 degrader to mark unhealthy hosts faster, significantly reducing p95 latency impact.
Files Changed