Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7c77dc2
Enable retries and timeouts by default
vcjana Dec 16, 2025
57679d5
Merge branch 'main' into fix-retry-defaults-clean
aws-sdk-rust-ci Dec 17, 2025
fc83a75
create v2 functions to avoid breaking changes
vcjana Dec 23, 2025
0f588c2
Add tests for retry config behavior version gating
vcjana Jan 6, 2026
efcaf60
Merge branch 'main' into fix-retry-defaults-clean
vcjana Jan 6, 2026
340d295
Fix timeout test to use old behavior version
vcjana Jan 6, 2026
a6a605b
Add allow(deprecated) to tests using old behavior versions
vcjana Jan 6, 2026
0477343
Use DefaultPluginParams and v2025_08_07 per review feedback
vcjana Jan 6, 2026
ea0221e
Add is_aws_sdk flag to enable retries for AWS SDK only
vcjana Jan 6, 2026
64203db
Explicitly disable operation timeouts for AWS SDK to fix timeout merg…
vcjana Jan 6, 2026
9cdf2a6
Fix TimeoutConfigMergingTest to match runtime behavior
vcjana Jan 6, 2026
929a051
Gate retry enablement by awsSdkBuild JSON setting
vcjana Jan 6, 2026
fb0de85
Fix formatting in defaults.rs
vcjana Jan 7, 2026
cb79e9d
Remove is_aws_sdk check from timeout config and add BehaviorVersion t…
vcjana Jan 9, 2026
64509b7
Fix rustfmt formatting
vcjana Jan 9, 2026
952324e
Merge branch 'main' into fix-retry-defaults-clean
vcjana Jan 9, 2026
61347dc
fix rustfmt formatting in timeouts.rs
vcjana Jan 9, 2026
b6fa58c
Rename tests and simplify retry_partition code
vcjana Jan 12, 2026
222a448
Enable retries by default in v2026_01_12 for AWS SDK clients
vcjana Jan 12, 2026
e42152e
Fix docs and version bump for behavior version changes
vcjana Jan 12, 2026
af7b2db
Merge branch 'main' into fix-retry-defaults-clean
vcjana Jan 13, 2026
320eddd
Remove AWS-specific docs from generic client
vcjana Jan 13, 2026
8aa96ab
Pin serde_json to 1.0.146 to fix flaky test
vcjana Jan 13, 2026
cffe1d6
Fix deprecation version and extract timeout constant
vcjana Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class TimeoutConfigMergingTest {
}
}
#{tokio_test}
##[expect(deprecated)]
async fn test_all_timeouts() {
let (_logs, _guard) = capture_test_logs();
let connect_timeout = Duration::from_secs(1);
Expand All @@ -66,7 +65,7 @@ class TimeoutConfigMergingTest {
let operation = Duration::from_secs(4);
let http_client = infallible_client_fn(|_req| http::Response::builder().body(SdkBody::empty()).unwrap());
let sdk_config = SdkConfig::builder()
.behavior_version(aws_smithy_runtime_api::client::behavior_version::BehaviorVersion::v2025_01_17())
.behavior_version(aws_smithy_runtime_api::client::behavior_version::BehaviorVersion::v2026_01_12())
.timeout_config(
TimeoutConfig::builder()
.connect_timeout(connect_timeout)
Expand Down
8 changes: 4 additions & 4 deletions aws/sdk/integration-tests/s3/tests/client_construction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ mod with_service_config {
}

#[test]
fn test_default_retry_enabled_with_bmv_2025_08_07() {
// With v2025_01_17 and later, retries are enabled by default for AWS SDK clients
fn test_default_retry_enabled_with_bmv_2026_01_12() {
// With v2026_01_12 and later, retries are enabled by default for AWS SDK clients
// This test verifies the client builds without panicking about missing sleep impl
let config = s3::Config::builder()
.behavior_version(BehaviorVersion::v2025_08_07())
.behavior_version(BehaviorVersion::v2026_01_12())
.region(aws_types::region::Region::new("us-east-1"))
.credentials_provider(aws_credential_types::Credentials::for_tests())
.build();
Expand All @@ -67,7 +67,7 @@ mod with_service_config {
#[test]
#[allow(deprecated)]
fn test_client_with_old_behavior_version_builds_successfully() {
// With v2024_03_28 (older than v2025_01_17), retries are NOT enabled by default
// With v2024_03_28 (older than v2026_01_12), retries are NOT enabled by default
// This test verifies the client builds without requiring a sleep impl
let config = s3::Config::builder()
.behavior_version(BehaviorVersion::v2024_03_28())
Expand Down
6 changes: 3 additions & 3 deletions aws/sdk/integration-tests/s3/tests/timeouts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ async fn test_connect_timeout() {
}

#[tokio::test]
#[expect(deprecated)]
async fn test_default_connect_timeout_with_bmv_2025_01_17() {
async fn test_default_connect_timeout_with_bmv_2026_01_12() {
use aws_smithy_runtime_api::client::behavior_version::BehaviorVersion;

// With BehaviorVersion >= v2025_01_17, a 3.1s connect timeout is enabled by default
// This test uses v2026_01_12 (the latest) to verify timeout behavior
let config = Config::builder()
.behavior_version(BehaviorVersion::v2025_01_17())
.behavior_version(BehaviorVersion::v2026_01_12())
.region(Region::new("us-east-1"))
.retry_config(RetryConfig::disabled())
.endpoint_url(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ enum Inner {
V2024_03_28,
V2025_01_17,
V2025_08_07,
V2026_01_12,
}

impl BehaviorVersion {
Expand All @@ -34,15 +35,28 @@ impl BehaviorVersion {
/// If, however, you're writing a service that is very latency sensitive, or that has written
/// code to tune Rust SDK behaviors, consider pinning to a specific major version.
///
/// The latest version is currently [`BehaviorVersion::v2025_08_07`]
/// The latest version is currently [`BehaviorVersion::v2026_01_12`]
pub fn latest() -> Self {
Self::v2025_08_07()
Self::v2026_01_12()
}

/// Behavior version for January 12th, 2026.
///
/// This version enables retries by default for all operations.
Comment thread
vcjana marked this conversation as resolved.
Outdated
pub fn v2026_01_12() -> Self {
Self {
inner: Inner::V2026_01_12,
}
}

/// Behavior version for August 7th, 2025.
///
/// This version updates the default HTTPS client to support proxy environment variables
/// (e.g. `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`) by default.
#[deprecated(
since = "1.10.0",
Comment thread
vcjana marked this conversation as resolved.
note = "Superseded by v2026_01_12, which enables retries by default for all operations."
Comment thread
vcjana marked this conversation as resolved.
Outdated
)]
pub fn v2025_08_07() -> Self {
Self {
inner: Inner::V2025_08_07,
Expand Down Expand Up @@ -123,10 +137,12 @@ mod tests {
assert!(BehaviorVersion::latest().is_at_least(BehaviorVersion::v2023_11_09()));
assert!(BehaviorVersion::latest().is_at_least(BehaviorVersion::v2024_03_28()));
assert!(BehaviorVersion::latest().is_at_least(BehaviorVersion::v2025_01_17()));
assert!(BehaviorVersion::latest().is_at_least(BehaviorVersion::v2025_08_07()));
assert!(!BehaviorVersion::v2023_11_09().is_at_least(BehaviorVersion::v2024_03_28()));
assert!(Inner::V2024_03_28 > Inner::V2023_11_09);
assert!(Inner::V2023_11_09 < Inner::V2024_03_28);
assert!(Inner::V2024_03_28 < Inner::V2025_01_17);
assert!(Inner::V2025_01_17 < Inner::V2025_08_07);
assert!(Inner::V2025_08_07 < Inner::V2026_01_12);
}
}
37 changes: 18 additions & 19 deletions rust-runtime/aws-smithy-runtime/src/client/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ pub fn default_http_client_plugin_v2(
) -> Option<SharedRuntimePlugin> {
let mut _default: Option<SharedHttpClient> = None;

#[expect(deprecated)]
if behavior_version.is_at_least(BehaviorVersion::v2025_01_17()) {
if behavior_version.is_at_least(BehaviorVersion::v2026_01_12()) {
// the latest https stack takes precedence if the config flag
// is enabled otherwise try to fall back to the legacy connector
// if that feature flag is available.
Expand Down Expand Up @@ -150,7 +149,7 @@ pub fn default_retry_config_plugin(
/// Runtime plugin that sets the default retry strategy, config, and partition.
///
/// This version respects the behavior version to enable retries by default for newer versions.
/// For AWS SDK clients with BehaviorVersion >= v2025_01_17, retries are enabled by default.
/// For AWS SDK clients with BehaviorVersion >= v2026_01_12, retries are enabled by default.
pub fn default_retry_config_plugin_v2(params: &DefaultPluginParams) -> Option<SharedRuntimePlugin> {
let retry_partition = RetryPartition::new(
params
Expand All @@ -173,9 +172,8 @@ pub fn default_retry_config_plugin_v2(params: &DefaultPluginParams) -> Option<Sh
.with_interceptor(TokenBucketProvider::new(retry_partition.clone()))
})
.with_config(layer("default_retry_config", |layer| {
#[expect(deprecated)]
let retry_config =
if is_aws_sdk && behavior_version.is_at_least(BehaviorVersion::v2025_01_17()) {
if is_aws_sdk && behavior_version.is_at_least(BehaviorVersion::v2026_01_12()) {
RetryConfig::standard()
} else {
RetryConfig::disabled()
Expand Down Expand Up @@ -224,7 +222,7 @@ pub fn default_timeout_config_plugin() -> Option<SharedRuntimePlugin> {
/// Runtime plugin that sets the default timeout config.
///
/// This version respects the behavior version to enable connection timeout by default for newer versions.
/// For all clients with BehaviorVersion >= v2025_01_17, a 3.1s connection timeout is set.
/// For all clients with BehaviorVersion > v2025_01_17 (i.e., v2025_08_07 and later), a 3.1s connection timeout is set.
pub fn default_timeout_config_plugin_v2(
params: &DefaultPluginParams,
) -> Option<SharedRuntimePlugin> {
Expand All @@ -239,8 +237,8 @@ pub fn default_timeout_config_plugin_v2(
})
.with_config(layer("default_timeout_config", |layer| {
#[expect(deprecated)]
let timeout_config = if behavior_version.is_at_least(BehaviorVersion::v2025_01_17()) {
// All clients with new behavior version: Set connect_timeout only
let timeout_config = if behavior_version.is_at_least(BehaviorVersion::v2025_08_07()) {
Comment thread
vcjana marked this conversation as resolved.
Outdated
// All clients with BMV > v2025_01_17: Set connect_timeout only
TimeoutConfig::builder()
.connect_timeout(Duration::from_millis(3100))
Comment thread
vcjana marked this conversation as resolved.
Outdated
.build()
Expand Down Expand Up @@ -479,7 +477,7 @@ mod tests {
#[test]
#[expect(deprecated)]
fn test_retry_disabled_for_aws_sdk_old_behavior_version() {
// Any version before v2025_01_17 should have retries disabled
// Any version before v2026_01_12 should have retries disabled
let params = DefaultPluginParams::new()
.with_retry_partition_name("test-partition")
.with_behavior_version(BehaviorVersion::v2024_03_28())
Expand All @@ -494,17 +492,16 @@ mod tests {
assert_eq!(
retry_config.max_attempts(),
1,
"retries should be disabled for AWS SDK with behavior version < v2025_01_17"
"retries should be disabled for AWS SDK with behavior version < v2026_01_12"
);
}

#[test]
#[expect(deprecated)]
fn test_retry_enabled_at_cutoff_version() {
// v2025_01_17 is the cutoff - retries should be enabled from this version onwards
// v2026_01_12 is the cutoff - retries should be enabled from this version onwards
let params = DefaultPluginParams::new()
.with_retry_partition_name("test-partition")
.with_behavior_version(BehaviorVersion::v2025_01_17())
.with_behavior_version(BehaviorVersion::v2026_01_12())
.with_is_aws_sdk(true);
let plugin = default_retry_config_plugin_v2(&params).expect("plugin should be created");

Expand All @@ -516,7 +513,7 @@ mod tests {
assert_eq!(
retry_config.max_attempts(),
3,
"retries should be enabled for AWS SDK starting from v2025_01_17"
"retries should be enabled for AWS SDK starting from v2026_01_12"
);
}

Expand Down Expand Up @@ -544,13 +541,15 @@ mod tests {
#[expect(deprecated)]
fn test_behavior_version_gates_retry_for_aws_sdk() {
// This test demonstrates the complete behavior:
// AWS SDK clients get retries enabled ONLY when BehaviorVersion >= v2025_01_17
// AWS SDK clients get retries enabled ONLY when BehaviorVersion >= v2026_01_12

// Test all behavior versions
let test_cases = vec![
(BehaviorVersion::v2023_11_09(), 1, "v2023_11_09 (old)"),
(BehaviorVersion::v2024_03_28(), 1, "v2024_03_28 (old)"),
(BehaviorVersion::v2025_01_17(), 3, "v2025_01_17 (cutoff)"),
(BehaviorVersion::v2025_01_17(), 1, "v2025_01_17 (old)"),
(BehaviorVersion::v2025_08_07(), 1, "v2025_08_07 (old)"),
(BehaviorVersion::v2026_01_12(), 3, "v2026_01_12 (cutoff)"),
(BehaviorVersion::latest(), 3, "latest"),
];

Expand Down Expand Up @@ -631,10 +630,10 @@ mod tests {
"Non-AWS SDK clients should always have retries disabled (1 attempt)"
);

// Scenario 4: Verify the cutoff version v2025_01_17 is the exact boundary
// Scenario 4: Verify the cutoff version v2026_01_12 is the exact boundary
let params_cutoff = DefaultPluginParams::new()
.with_retry_partition_name("aws-s3")
.with_behavior_version(BehaviorVersion::v2025_01_17())
.with_behavior_version(BehaviorVersion::v2026_01_12())
.with_is_aws_sdk(true);

let config_cutoff = config_for(default_plugins(params_cutoff));
Expand All @@ -644,7 +643,7 @@ mod tests {
assert_eq!(
retry_cutoff.max_attempts(),
3,
"AWS SDK with v2025_01_17 (the cutoff version) should have retries enabled (3 attempts)"
"AWS SDK with v2026_01_12 (the cutoff version) should have retries enabled (3 attempts)"
);
}
}
1 change: 1 addition & 0 deletions rust-runtime/aws-smithy-runtime/src/client/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ pub(crate) fn default_https_client(options: DefaultClientOptions) -> Option<Shar
conn_builder.set_sleep_impl(components.sleep_impl());
}

#[expect(deprecated)]
if options
.behavior_version
.is_at_least(BehaviorVersion::v2025_08_07())
Expand Down
Loading