Skip to content

Commit

Permalink
set 40 seconds stream protection grace to s3 client
Browse files Browse the repository at this point in the history
  • Loading branch information
eaypek-tfh committed Jan 13, 2025
1 parent ea88363 commit 8a1ae89
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion iris-mpc/src/bin/server.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#![allow(clippy::needless_range_loop)]

use aws_config::retry::RetryConfig;
use aws_sdk_s3::{config::Builder as S3ConfigBuilder, Client as S3Client};
use aws_sdk_s3::{
config::{Builder as S3ConfigBuilder, StalledStreamProtectionConfig},
Client as S3Client,
};
use aws_sdk_sns::{types::MessageAttributeValue, Client as SNSClient};
use aws_sdk_sqs::{config::Region, Client};
use axum::{response::IntoResponse, routing::get, Router};
Expand Down Expand Up @@ -688,7 +691,13 @@ async fn server_main(config: Config) -> eyre::Result<()> {

// Increase S3 retries to 5
let retry_config = RetryConfig::standard().with_max_attempts(5);

// Bump stalled stream protection grace period to 30 seconds
let mut stream_protection = StalledStreamProtectionConfig::enabled();
stream_protection.set_grace_period(Some(Duration::from_secs(40)));

let s3_config = S3ConfigBuilder::from(&shared_config)
.stalled_stream_protection(stream_protection.build())
.retry_config(retry_config)
.build();
let s3_client = Arc::new(S3Client::from_conf(s3_config));
Expand Down

0 comments on commit 8a1ae89

Please sign in to comment.