Skip to content

Commit a513434

Browse files
danielbelchiorebyhr
authored andcommitted
Rename S3 Filesystem config socket-read-timeout to socket-timeout
The property `s3.socket-read-timeout` was misleading, as it sets the underlying HTTP client's `socketTimeout`, which controls both read and write timeouts. To avoid confusion and better reflect its actual behavior, the property has been renamed to `s3.socket-timeout`. This change improves clarity for users configuring timeouts in the S3 filesystem and aligns the property name with its actual semantics.
1 parent 6abf6a9 commit a513434

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

docs/src/main/sphinx/object-storage/file-system-s3.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ support:
7979
* - `s3.socket-connect-timeout`
8080
- Maximum time [duration](prop-type-duration) allowed for socket connection
8181
requests to complete before timing out.
82-
* - `s3.socket-read-timeout`
83-
- Maximum time [duration](prop-type-duration) for socket read operations
82+
* - `s3.socket-timeout`
83+
- Maximum time [duration](prop-type-duration) for socket read/write operations
8484
before timing out.
8585
* - `s3.tcp-keep-alive`
8686
- Enable TCP keep alive on created connections. Defaults to `false`.
@@ -383,7 +383,7 @@ the following edits to your catalog configuration:
383383
- Also see `s3.connection-max-idle-time` in preceding section for more
384384
connection keep-alive options.
385385
* - `hive.s3.socket-timeout`
386-
- `s3.socket-read-timeout`
386+
- `s3.socket-timeout`
387387
- Also see `s3.tcp-keep-alive` in preceding sections for more socket
388388
connection keep-alive options.
389389
* - `hive.s3.max-connections`

lib/trino-filesystem-s3/src/main/java/io/trino/filesystem/s3/S3FileSystemConfig.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import io.airlift.configuration.Config;
2020
import io.airlift.configuration.ConfigDescription;
2121
import io.airlift.configuration.ConfigSecuritySensitive;
22+
import io.airlift.configuration.LegacyConfig;
2223
import io.airlift.units.DataSize;
2324
import io.airlift.units.Duration;
2425
import io.airlift.units.MaxDataSize;
@@ -163,7 +164,7 @@ public static RetryStrategy getRetryStrategy(RetryMode retryMode)
163164
private Duration connectionTtl;
164165
private Duration connectionMaxIdleTime;
165166
private Duration socketConnectTimeout;
166-
private Duration socketReadTimeout;
167+
private Duration socketTimeout;
167168
private boolean tcpKeepAlive;
168169
private HostAndPort httpProxy;
169170
private boolean httpProxySecure;
@@ -511,16 +512,17 @@ public S3FileSystemConfig setSocketConnectTimeout(Duration socketConnectTimeout)
511512
return this;
512513
}
513514

514-
public Optional<Duration> getSocketReadTimeout()
515+
public Optional<Duration> getSocketTimeout()
515516
{
516-
return Optional.ofNullable(socketReadTimeout);
517+
return Optional.ofNullable(socketTimeout);
517518
}
518519

519-
@Config("s3.socket-read-timeout")
520-
@ConfigDescription("Maximum time allowed for socket reads before timing out")
521-
public S3FileSystemConfig setSocketReadTimeout(Duration socketReadTimeout)
520+
@LegacyConfig("s3.socket-read-timeout")
521+
@Config("s3.socket-timeout")
522+
@ConfigDescription("Maximum time allowed for socket reads/writes before timing out")
523+
public S3FileSystemConfig setSocketTimeout(Duration socketTimeout)
522524
{
523-
this.socketReadTimeout = socketReadTimeout;
525+
this.socketTimeout = socketTimeout;
524526
return this;
525527
}
526528

lib/trino-filesystem-s3/src/main/java/io/trino/filesystem/s3/S3FileSystemLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ private static SdkHttpClient createHttpClient(S3FileSystemConfig config)
301301
config.getConnectionTtl().ifPresent(ttl -> client.connectionTimeToLive(ttl.toJavaTime()));
302302
config.getConnectionMaxIdleTime().ifPresent(time -> client.connectionMaxIdleTime(time.toJavaTime()));
303303
config.getSocketConnectTimeout().ifPresent(timeout -> client.connectionTimeout(timeout.toJavaTime()));
304-
config.getSocketReadTimeout().ifPresent(timeout -> client.socketTimeout(timeout.toJavaTime()));
304+
config.getSocketTimeout().ifPresent(timeout -> client.socketTimeout(timeout.toJavaTime()));
305305

306306
if (config.getHttpProxy() != null) {
307307
client.proxyConfiguration(ProxyConfiguration.builder()

lib/trino-filesystem-s3/src/test/java/io/trino/filesystem/s3/TestS3FileSystemConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void testDefaults()
6767
.setConnectionTtl(null)
6868
.setConnectionMaxIdleTime(null)
6969
.setSocketConnectTimeout(null)
70-
.setSocketReadTimeout(null)
70+
.setSocketTimeout(null)
7171
.setTcpKeepAlive(false)
7272
.setHttpProxy(null)
7373
.setHttpProxySecure(false)
@@ -109,7 +109,7 @@ public void testExplicitPropertyMappings()
109109
.put("s3.connection-ttl", "1m")
110110
.put("s3.connection-max-idle-time", "2m")
111111
.put("s3.socket-connect-timeout", "3m")
112-
.put("s3.socket-read-timeout", "4m")
112+
.put("s3.socket-timeout", "4m")
113113
.put("s3.tcp-keep-alive", "true")
114114
.put("s3.http-proxy", "localhost:8888")
115115
.put("s3.http-proxy.secure", "true")
@@ -148,7 +148,7 @@ public void testExplicitPropertyMappings()
148148
.setConnectionTtl(new Duration(1, MINUTES))
149149
.setConnectionMaxIdleTime(new Duration(2, MINUTES))
150150
.setSocketConnectTimeout(new Duration(3, MINUTES))
151-
.setSocketReadTimeout(new Duration(4, MINUTES))
151+
.setSocketTimeout(new Duration(4, MINUTES))
152152
.setTcpKeepAlive(true)
153153
.setHttpProxy(HostAndPort.fromParts("localhost", 8888))
154154
.setHttpProxySecure(true)

0 commit comments

Comments
 (0)