From e78da5598a2d94d23fd18e30492a20ce3603f844 Mon Sep 17 00:00:00 2001 From: Kevin Park Date: Thu, 6 Oct 2022 20:10:14 -0400 Subject: [PATCH] Fix regression: Use `connect_timeout` and `read_timeout` again (#1822) (#1823) --- CHANGELOG.next.toml | 6 ++++++ aws/rust-runtime/aws-config/src/imds/client.rs | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index 60a2386ebf..02caa3a350 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -125,3 +125,9 @@ message = "The client Config now has getters for every value that it holds." references = ["smithy-rs#1747"] meta = { "breaking" = false, "tada" = false, "bug" = true } author = "kastolars" + +[[aws-sdk-rust]] +message = "Fix regression where `connect_timeout` and `read_timeout` fields are unused in the IMDS client" +references = ["smithy-rs#1822"] +meta = { "breaking" = false, "tada" = false, "bug" = true } +author = "kevinpark1217" diff --git a/aws/rust-runtime/aws-config/src/imds/client.rs b/aws/rust-runtime/aws-config/src/imds/client.rs index 10e6d419ab..f853e7bc90 100644 --- a/aws/rust-runtime/aws-config/src/imds/client.rs +++ b/aws/rust-runtime/aws-config/src/imds/client.rs @@ -556,8 +556,8 @@ impl Builder { pub async fn build(self) -> Result { let config = self.config.unwrap_or_default(); let timeout_config = TimeoutConfig::builder() - .connect_timeout(DEFAULT_CONNECT_TIMEOUT) - .read_timeout(DEFAULT_READ_TIMEOUT) + .connect_timeout(self.connect_timeout.unwrap_or(DEFAULT_CONNECT_TIMEOUT)) + .read_timeout(self.read_timeout.unwrap_or(DEFAULT_READ_TIMEOUT)) .build(); let connector_settings = ConnectorSettings::from_timeout_config(&timeout_config); let connector = expect_connector(config.connector(&connector_settings));