From d3545cd440ad861b78f60eec7a756fb46ac88bd3 Mon Sep 17 00:00:00 2001 From: Shichao Nie Date: Mon, 13 Nov 2023 14:29:24 +0800 Subject: [PATCH] feat(s3stream): add s3 operation timeout (#618) Signed-off-by: Shichao Nie --- .../java/com/automq/stream/s3/operator/DefaultS3Operator.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/s3stream/src/main/java/com/automq/stream/s3/operator/DefaultS3Operator.java b/s3stream/src/main/java/com/automq/stream/s3/operator/DefaultS3Operator.java index e329412184..b2dfe9d4d5 100644 --- a/s3stream/src/main/java/com/automq/stream/s3/operator/DefaultS3Operator.java +++ b/s3stream/src/main/java/com/automq/stream/s3/operator/DefaultS3Operator.java @@ -60,6 +60,7 @@ import java.net.URI; import java.nio.charset.StandardCharsets; +import java.time.Duration; import java.util.ArrayList; import java.util.Collections; import java.util.Date; @@ -571,6 +572,8 @@ private static S3AsyncClient newS3Client(String endpoint, String region, boolean AnonymousCredentialsProvider.create() ).build() ); + builder.overrideConfiguration(b -> b.apiCallTimeout(Duration.ofMinutes(1)) + .apiCallAttemptTimeout(Duration.ofSeconds(30))); return builder.build(); }