[DO NOT MERGE] [Default Read/Write Timeout] Merge feature branch: SDK-managed default read/write timeout for CRT-based HTTP clients (off by default) - #7336
Open
zoewangg wants to merge 7 commits into
Conversation
Mirror the AWS_NEW_RETRIES_2026 gate: add the AWS_ENABLE_DEFAULT_READ_TIMEOUT_2026 system setting, its resolver, the DEFAULT_ENABLE_READ_TIMEOUT_2026 client option, and the codegen customization field that bakes it into mergeInternalDefaults. Nothing consumes the gate yet; the aws-core and CRT client wiring follow separately.
The CRT-based HTTP clients now honor SDK_INTERNAL_FALLBACK_READ_WRITE_TIMEOUT, mapping it onto an HttpMonitoringOptions minimum-throughput monitor. An explicit ConnectionHealthConfiguration takes precedence; a standalone client reads the opt-in environment variable directly.
Codegen bakes each listed service's default read/write timeout tier into its generated serviceHttpConfig from a checked-in exemption artifact; aws-core applies the rollout gate to the baked value.
… to SDK-managed clients (#7334) * fix: scope CRT default timeout to managed clients A directly-supplied CRT client is caller-owned (buildWithDefaults is not called on it) and is often shared across services with different exemption tiers, so applying a flat default could break an exempt service. The client no longer reads the opt-in setting itself; the default now applies only to SDK-managed clients, via the option resolved in aws-core. * docs: clarify CRT default timeout scope in Javadoc Document that the CRT builder's connectionHealthConfiguration applies an automatic default only for SDK-managed clients; a directly-supplied or standalone client gets no default and honors only an explicit configuration.
Rename the interim rollout-gate symbols (system setting, env var, property, resolver, client option, codegen customization) from the READ name to the cross-SDK-settled SOCKET name. Behavior-preserving. SDK_INTERNAL_FALLBACK_READ_WRITE_TIMEOUT is intentionally not renamed; it names the read+write mechanism value, not the gate.
alextwoods
reviewed
Sep 4, 2026
| * | ||
| * <p> | ||
| * Disabled by default. | ||
| * <p>When this client is created and managed by an AWS SDK service client, a default read/write inactivity timeout |
Contributor
There was a problem hiding this comment.
One weird case I'm thinking through - if a customer shares a http client builder and supplies it across multiple services, each will end up getting its own, seperate socket timeouts applies (since we consider the customer supplied builder still an SDK managed instance). I don't think thats incorrect, but it might be slightly confusing. What do you think?
Contributor
Author
There was a problem hiding this comment.
Discussed offline, pushed a commit to update the doc 2061611
alextwoods
previously approved these changes
Sep 4, 2026
zoewangg
dismissed
alextwoods’s stale review
September 4, 2026 17:01
Dismissing the review since we are not merging at this time.
A supplied httpClientBuilder is used to build a new HTTP client instance for each service client, each with that service's HTTP defaults, so sharing one builder across clients yields separate instances with their own connection pools. Document this and point to httpClient(...) for sharing a single instance.
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
Merges the
feature/master/2026-enable-default-read-timeoutfeature branch intomaster. This adds an SDK-managed default read/write (socket) inactivity timeout for HTTP clients that do not enforce one of their own — currently only the AWS CRT-based clients (AwsCrtHttpClient/AwsCrtAsyncHttpClient). Apache and Netty already apply their own read/write timeouts and are unaffected.The behavior is off by default and gated behind an opt-in flag: the
AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026environment variable /aws.enableDefaultSocketTimeout2026system property. Upgrading changes no behavior unless a customer explicitly opts in.When enabled, the SDK resolves a per-service timeout and applies it to the CRT client, which shuts down a connection that transfers no bytes in either direction for the resolved window, failing the in-flight request with a retryable
IOException.Constituent PRs
This feature was developed and reviewed incrementally on the feature branch. This PR is the aggregate merge of the following already-reviewed-and-merged PRs:
AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026Related (already merged directly to
master): #7348 — adds the no-opdefaultEnableSocketTimeout2026codegen customization-config field.Key behavior
connectionHealthConfigurationalways takes precedence.Public API
No new public API. The CRT
connectionHealthConfiguration(...)methods are unchanged in signature; only their Javadoc was reframed to document the read/write inactivity timeout behavior.Testing
Covered by the constituent PRs: rollout-gate resolver precedence, CRT timeout mapping and explicit-config-precedence, and CRT long-running-request tests.
Reviewer note
Each change above was reviewed individually; this PR is for a holistic review of the combined feature before it merges to
master.