What each timeout bounds#
A call to an AWS service goes through four phases that can each stall: opening the connection, sending the request, waiting for the response headers, and reading the body. The SDK for Rust has a separate setting for each span. Configuring timeouts in the AWS SDK for Rust lists them:
- Connect timeout, 3.1 seconds by default: the wait for a connection.
- Read timeout: the wait from sending the request to the first byte of the response.
- Operation attempt timeout: the whole of one HTTP attempt.
- Operation timeout: the whole call, across every retry.
That page's table gives no default for the last three. It describes the behavior versions before v2026_11_17. A peer that completed the TCP handshake, perhaps a proxy, a load balancer with a dead target or a server stuck in a lock, could hold a call on the read for as long as the connection lived. On Linux, a connection waiting to read with no data in flight has no timeout of its own, and a TCP keepalive probe does not help: the peer's kernel answers it whether or not the application ever will.
What v2026_11_17 changes#
The SDK ties changes in default behavior to a BehaviorVersion, so that upgrading a crate does not change behavior unless you ask for the new version. BehaviorVersion::latest() asks for whatever the crate you compiled against considers newest. The BehaviorVersion documentation describes v2026_11_17 as applying a default read timeout that "bounds the span from request dispatch until response headers arrive". The value depends on the service: 5 minutes generally, 15 minutes for services that legitimately hold a connection open before replying, and none for services where a bound would break normal use, such as S3, which cannot send response headers before a large upload finishes. A read timeout you configure yourself always wins.
The change landed in smithy-rs pull request 5004. In the generated crates, aws-sdk-sts 1.127.0 stores 300,000 ms and aws-sdk-rds 1.163.0 stores 900,000 ms.
A client pinned to an older version, such as BehaviorVersion::v2026_01_12(), keeps the old behavior after the upgrade. The older constructors are deprecated, so the compiler warns about them.
The lab#
The lab points an STS client at a local socket that accepts connections and never answers, then calls GetCallerIdentity three ways: with latest(), with an older behavior version, and with explicit timeouts. A tokio timeout of 20 minutes stops the call that would otherwise never end. Cargo.toml:
[dependencies]
aws-config = "=1.13.3"
aws-sdk-sts = "=1.127.0"
tokio = { version = "1", features = ["full"] }
src/main.rs:
use std::{net::TcpListener, sync::atomic::{AtomicUsize, Ordering}, sync::Arc, thread, time::{Duration, Instant}};
use aws_config::{timeout::TimeoutConfig, BehaviorVersion};
#[tokio::main]
async fn main() {
// A peer that accepts every connection and never answers.
let listener = TcpListener::bind("127.0.0.1:0").unwrap();
let endpoint = format!("http://{}", listener.local_addr().unwrap());
let accepted = Arc::new(AtomicUsize::new(0));
let count = accepted.clone();
thread::spawn(move || {
let mut held = Vec::new();
for stream in listener.incoming() {
count.fetch_add(1, Ordering::SeqCst);
held.push(stream.unwrap());
}
});
let variant = std::env::args().nth(1).unwrap_or_default();
let behavior = if variant == "old" { BehaviorVersion::v2026_01_12() } else { BehaviorVersion::latest() };
let mut loader = aws_config::defaults(behavior).region("us-east-1").endpoint_url(&endpoint);
if variant == "explicit" {
loader = loader.timeout_config(
TimeoutConfig::builder()
.connect_timeout(Duration::from_secs(3))
.read_timeout(Duration::from_secs(5))
.operation_timeout(Duration::from_secs(30))
.build(),
);
}
let sts = aws_sdk_sts::Client::new(&loader.load().await);
let start = Instant::now();
let call = sts.get_caller_identity().send();
match tokio::time::timeout(Duration::from_secs(1200), call).await {
Ok(Ok(_)) => println!("{variant}: answered"),
Ok(Err(e)) => println!("{variant}: error after {:.1} s, {} connections: {:?}",
start.elapsed().as_secs_f64(), accepted.load(Ordering::SeqCst),
aws_sdk_sts::error::DisplayErrorContext(&e)),
Err(_) => println!("{variant}: still waiting after {:.0} s, {} connections",
start.elapsed().as_secs_f64(), accepted.load(Ordering::SeqCst)),
}
}
docker run --rm -v "$PWD":/lab -w /lab rust:1 cargo build --release
for v in latest old explicit; do
docker run -d --name sts-$v -e AWS_ACCESS_KEY_ID=test -e AWS_SECRET_ACCESS_KEY=test \
-e AWS_EC2_METADATA_DISABLED=true -v "$PWD":/lab -w /lab rust:1 ./target/release/sts-hang $v
done
The build took three minutes; the slowest run takes 20. The three runs printed, trimmed:
explicit: error after 15.1 s, 3 connections: ... HttpTimeoutError { kind: "HTTP read", duration: 5s } ...
latest: error after 900.1 s, 3 connections: ... HttpTimeoutError { kind: "HTTP read", duration: 300s } ...
old: still waiting after 1200 s, 1 connections
The old behavior version opened one connection and was still waiting when the lab gave up 20 minutes later; nothing in the SDK would have ended it. latest() timed out after 300 seconds, retried twice on new connections, and failed after 900 seconds, three full read timeouts. With a 5-second read timeout the same three attempts took 15 seconds. The retries are the part people miss: the default read timeout bounds one attempt, and the standard retry policy makes three.
Choose your own bounds#
The new default is a backstop. It ends a call that would otherwise hold a task, a connection-pool slot or a lock until a restart, and a hung process caused by one looks like a deadlock until you read its stacks. It does not make the call fit your request's deadline. Set the bounds from what the caller can wait:
let config = aws_config::defaults(BehaviorVersion::latest())
.timeout_config(
TimeoutConfig::builder()
.operation_attempt_timeout(Duration::from_secs(10))
.operation_timeout(Duration::from_secs(30))
.build(),
)
.load()
.await;
An attempt timeout bounds each try; the operation timeout caps all of them together, retries and backoff included. Neither applies to a streamed body that you read after the SDK has returned the response; stalled-stream protection covers that.
Check three things in your own code:
- Search for
BehaviorVersion::v20to find clients pinned to an older version. They keep the old behavior until you move them. - Find every client built without a
TimeoutConfig, especially those used inside a request handler or while holding a lock. - Keep the client's timeouts below the timeout of whatever calls you, so your code reports the AWS call as the cause instead of being cut off by its own caller.
Long-lived connections that die quietly in a NAT or load balancer are a different failure, with resets rather than waits; see connection resets on idle pooled connections.
The production case#
In the production case behind this guide, a control plane assumed AWS roles through STS from five call sites, all on clients built with BehaviorVersion::latest() and none with a timeout of its own. Before the change, an STS endpoint that accepted a request and never sent response headers would have held the call until the operating system gave up. The fix moved seven crates of the SDK family to the 17 November 2026 release, a lock-file change with no source edits, which made latest() resolve to v2026_11_17: a 300,000 ms read timeout on STS and 900,000 ms on RDS, each retried as a transient error.
Where this came from#
Proofline found this in its own STS calls and shipped the SDK upgrade in its production release of 18 November 2026. The timeout values in The production case are the ones those crates store. Proofline reviews GitHub pull requests; new organizations get one calendar month of hosted code review without a cloud connection. Start a free GitHub review ยท Eligibility and fair-use terms
Questions#
Does the AWS SDK for Rust have a default timeout?
It has a 3.1-second connect timeout. From behavior version v2026_11_17 it also has a per-service read timeout, 5 minutes for most services and none for S3. It has no default attempt or operation timeout.
Does upgrading the SDK crates change timeouts by itself?
Only for clients built with BehaviorVersion::latest(). A client pinned to an older behavior version keeps that version's defaults.
Is a read timeout retried?
Yes. The SDK classifies it as a transient error and retries it under the client's retry policy, three attempts in total by default, so the header waits can add up across attempts. Allow for retry backoff when you choose an overall operation timeout.