[Default Read/Write Timeout 3/N] Bake per-service exemption tiers and apply the rollout gate - #7329
Open
zoewangg wants to merge 1 commit into
Conversation
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.
Fred1155
reviewed
Aug 28, 2026
| * The flat default read/write inactivity timeout applied when the rollout gate is on and the service is not listed in the | ||
| * codegen exemption artifact. | ||
| */ | ||
| private static final Duration DEFAULT_READ_WRITE_TIMEOUT = Duration.ofMinutes(5); |
Contributor
There was a problem hiding this comment.
If the http client is passed in directly, like S3AsyncClient.builder().httpClient(AwsCrtAsyncHttpClient.create())? ServiceHttpConfig() never reaches it in that case, so all service would fall back to the 5 min behavior.
| new LowercaseShapeValidatorProcessor(), | ||
| new LongPollingOperationProcessor() | ||
| new LongPollingOperationProcessor(), | ||
| new DefaultReadWriteTimeoutExemptionProcessor() |
Contributor
There was a problem hiding this comment.
Just curious: do we intend to remove this processor and the json artifact at the end of the rolling out?
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.
Motivation and Context
Increment 3 of N for the default read/write inactivity timeout on the AWS CRT-based HTTP clients. This increment targets the feature branch
feature/master/2026-enable-default-read-timeout, on top of increment 1 (theAWS_ENABLE_DEFAULT_READ_TIMEOUT_2026rollout gate, #7319) and increment 2 (the CRT client applying the resolvedSdkHttpConfigurationOption.SDK_INTERNAL_FALLBACK_READ_WRITE_TIMEOUT, #7326).Not every service should get the same default. Some services stream or hold connections open for long periods, so a single flat inactivity timeout would break them. This increment introduces the per-service exemption tiers and wires the rollout gate to the resolved value:
The per-service tier is independent of the rollout gate and is resolved at code-generation time (service identity does not reach the HTTP client). The gate is then applied once, above the HTTP client, so the value handed is already gate-resolved.
Modifications
Code generation (
codegen):DefaultReadWriteTimeoutExemptionProcessor(registered inDefaultCustomizationProcessor, alongsideLongPollingOperationProcessor) reads a checked-in exemption artifact (default-read-write-timeout-exemptions.json, keyed by service sdkId) and bakes each listed service's tier onto the intermediate model:-1marks a fully-exempt service, a positive value is the timeout in milliseconds.Metadatacarries the baked tier (defaultReadWriteTimeoutMillis);BaseClientBuilderClassemits it into the generatedserviceHttpConfig()asSDK_INTERNAL_FALLBACK_READ_WRITE_TIMEOUT(Duration.ZEROfor fully-exempt,Duration.ofMillis(...)for a positive tier), composing with any existing service HTTP config (e.g. HTTP/2). Services absent from the artifact bake nothing.aws-core:AwsDefaultClientBuilder.resolveHttpClientConfigapplies the rollout gate to the codegen-baked value. The gate is resolved via theAWS_ENABLE_DEFAULT_READ_TIMEOUT_2026environment variable / system property, else the codegen-bakedSdkClientOption.DEFAULT_ENABLE_READ_TIMEOUT_2026default, else off.Duration.ZEROfully-exempt, 15 minutes partial); an unlisted service (nothing baked) gets the flat 5-minute default.Duration.ZEROso it cannot apply; otherwise the option is left untouched (an unlisted service stays absent, which is equivalent toDuration.ZERObecause the HTTP client's option-absent path applies nothing when the gate is off; a fully-exempt tier is alreadyDuration.ZERO).The CRT client (increment 2) consumes this resolved value and does not re-evaluate the gate. Other HTTP clients ignore the option. No public API is added or changed.
Testing
codegenmodule builds and tests pass. New tests:DefaultReadWriteTimeoutExemptionProcessorTest(each artifact key bakes its declared tier; case-sensitivity; every key cross-checked against the real service sdkId set; bogus-key guard fires), a full-class fixture-comparison test for the generatedserviceHttpConfig()(partial tier composed with HTTP/2), and programmatic emission cases (fully-exemptDuration.ZERO, partialDuration.ofMillis, unlisted omitted).aws-coremodule builds and tests pass. NewAwsDefaultClientBuilderReadWriteTimeoutTestparameterizes the gate/tier matrix (gate off + partial ->ZERO; gate on + unlisted -> 5 min; gate on + fully-exempt ->ZERO; gate on + partial -> 15 min; gate on via codegen default -> 5 min; gate property false overrides the codegen default ->ZERO) plus an explicit case that an unlisted, gated-off service leaves the option absent.Duration.ofMillis(900000L), Polly (fully-exempt, HTTP/2) composes the HTTP/2 config withDuration.ZERO, STS (unlisted) bakes nothing.Types of changes
Checklist
mvn installsucceeds (built and tested the affected modules:codegenandaws-core)License