Skip to content

Commit e967e78

Browse files
branch-4.0: [improve](iceberg rest) Add a default network connection timeout to Iceberg REST apache#58395 (apache#58436)
Cherry-picked from apache#58395 Co-authored-by: zy-kkk <[email protected]>
1 parent 807a625 commit e967e78

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/IcebergRestProperties.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,16 @@ public class IcebergRestProperties extends AbstractIcebergProperties {
153153
description = "The secret access key for the iceberg rest catalog service.")
154154
private String icebergRestSecretAccessKey = "";
155155

156+
@ConnectorProperty(names = {"iceberg.rest.connection-timeout-ms"},
157+
required = false,
158+
description = "Connection timeout in milliseconds for the REST catalog HTTP client. Default: 10000 (10s).")
159+
private String icebergRestConnectionTimeoutMs = "10000";
160+
161+
@ConnectorProperty(names = {"iceberg.rest.socket-timeout-ms"},
162+
required = false,
163+
description = "Socket timeout in milliseconds for the REST catalog HTTP client. Default: 60000 (60s).")
164+
private String icebergRestSocketTimeoutMs = "60000";
165+
156166
protected IcebergRestProperties(Map<String, String> props) {
157167
super(props);
158168
}
@@ -259,6 +269,13 @@ private void addOptionalProperties() {
259269
if (isIcebergRestVendedCredentialsEnabled()) {
260270
icebergRestCatalogProperties.put(VENDED_CREDENTIALS_HEADER, VENDED_CREDENTIALS_VALUE);
261271
}
272+
273+
if (Strings.isNotBlank(icebergRestConnectionTimeoutMs)) {
274+
icebergRestCatalogProperties.put("rest.client.connection-timeout-ms", icebergRestConnectionTimeoutMs);
275+
}
276+
if (Strings.isNotBlank(icebergRestSocketTimeoutMs)) {
277+
icebergRestCatalogProperties.put("rest.client.socket-timeout-ms", icebergRestSocketTimeoutMs);
278+
}
262279
}
263280

264281
private void addAuthenticationProperties() {

0 commit comments

Comments
 (0)