Skip to main content

Module retry

Module retry 

Source
Expand description

Retry helper for transient Bedrock errors.

Bedrock throttles aggressively under load. This module implements exponential backoff + jitter for ThrottlingException (HTTP 429) and ServiceUnavailableException (HTTP 503). Non-retryable errors (auth, validation, 4xx other than 429) are returned immediately.

§Examples

use codetether_agent::provider::bedrock::retry::{RetryPolicy, should_retry_status};

let policy = RetryPolicy::default();
assert_eq!(policy.max_attempts, 4);
assert!(should_retry_status(429));
assert!(should_retry_status(503));
assert!(!should_retry_status(400));
assert!(!should_retry_status(200));

Structs§

RetryPolicy
Exponential backoff config.

Functions§

should_retry_status
Return true for HTTP status codes worth retrying.