Skip to content

Commit 9ec34b7

Browse files
committed
disable aws sdk retries, lambda should handle
1 parent 894f821 commit 9ec34b7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/implementation.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub mod lambda_private {
99
use aws_sdk_lambda::types::InvocationType;
1010
use aws_credential_types::Credentials;
1111
use aws_types::region::Region;
12+
use aws_sdk_lambda::config::retry::RetryConfig;
1213
use bytes::Bytes;
1314
use std::error::Error;
1415
use std::sync::Arc;
@@ -127,7 +128,13 @@ pub mod lambda_private {
127128
.await
128129
};
129130

130-
let mut lambda_config = LambdaConfigBuilder::from(&sdk_config);
131+
// Disable SDK retries - let Varnish handle retry logic at a higher level.
132+
// This prevents worker threads from being blocked during exponential backoff
133+
// and ensures metrics (inflight, throttled, fail) are accurate.
134+
let retry_config = RetryConfig::standard().with_max_attempts(1);
135+
136+
let mut lambda_config = LambdaConfigBuilder::from(&sdk_config)
137+
.retry_config(retry_config);
131138
if let Some(url) = endpoint_url {
132139
lambda_config = lambda_config.endpoint_url(url);
133140
}

0 commit comments

Comments
 (0)