Skip to content

Commit 3f98cb6

Browse files
HADOOP-19045. CreateSession Timeout - followup (apache#6532)
This is a followup to PR: HADOOP-19045. S3A: Validate CreateSession Timeout Propagation (apache#6470) Remove all declarations of fs.s3a.connection.request.timeout in - hadoop-common/src/main/resources/core-default.xml - hadoop-aws/src/test/resources/core-site.xml New test in TestAwsClientConfig to verify that the value defined in fs.s3a.Constants class is used. This is brittle to someone overriding it in their test setups, but as this test is intended to verify that the option is not explicitly set, there's no workaround. Contributed by Steve Loughran
1 parent 5ad7737 commit 3f98cb6

File tree

5 files changed

+18
-21
lines changed

5 files changed

+18
-21
lines changed

hadoop-common-project/hadoop-common/src/main/resources/core-default.xml

-14
Original file line numberDiff line numberDiff line change
@@ -2097,20 +2097,6 @@
20972097
</description>
20982098
</property>
20992099

2100-
<property>
2101-
<name>fs.s3a.connection.request.timeout</name>
2102-
<value>0s</value>
2103-
<description>
2104-
Time out on HTTP requests to the AWS service; 0 means no timeout.
2105-
2106-
Important: this is the maximum duration of any AWS service call,
2107-
including upload and copy operations. If non-zero, it must be larger
2108-
than the time to upload multi-megabyte blocks to S3 from the client,
2109-
and to rename many-GB files. Use with care.
2110-
2111-
</description>
2112-
</property>
2113-
21142100
<property>
21152101
<name>fs.s3a.etag.checksum.enabled</name>
21162102
<value>false</value>

hadoop-tools/hadoop-aws/src/site/markdown/tools/hadoop-aws/performance.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ The choice is yours. Generally recovery is better, but sometimes fail-fast is mo
231231
| `fs.s3a.connection.acquisition.timeout` | `60s` | `*` | Timeout for waiting for a connection from the pool. |
232232
| `fs.s3a.connection.establish.timeout` | `30s` | | Time to establish the TCP/TLS connection |
233233
| `fs.s3a.connection.idle.time` | `60s` | `*` | Maximum time for idle HTTP connections in the pool |
234-
| `fs.s3a.connection.request.timeout` | `0` | | If greater than zero, maximum duration of any request |
234+
| `fs.s3a.connection.request.timeout` | `60s` | | If greater than zero, maximum time for a response |
235235
| `fs.s3a.connection.timeout` | `200s` | | Timeout for socket problems on a TCP channel |
236236
| `fs.s3a.connection.ttl` | `5m` | | Lifetime of HTTP connections from the pool |
237237

hadoop-tools/hadoop-aws/src/site/markdown/tools/hadoop-aws/troubleshooting_s3a.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1510,7 +1510,7 @@ It is possible to configure a global timeout for AWS service calls using followi
15101510
```xml
15111511
<property>
15121512
<name>fs.s3a.connection.request.timeout</name>
1513-
<value>0</value>
1513+
<value>5m</value>
15141514
<description>
15151515
Time out on HTTP requests to the AWS service; 0 means no timeout.
15161516
Measured in seconds; the usual time suffixes are all supported

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/impl/TestAwsClientConfig.java

+16
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import static org.apache.hadoop.fs.s3a.Constants.DEFAULT_CONNECTION_TTL_DURATION;
4141
import static org.apache.hadoop.fs.s3a.Constants.DEFAULT_ESTABLISH_TIMEOUT_DURATION;
4242
import static org.apache.hadoop.fs.s3a.Constants.DEFAULT_MAXIMUM_CONNECTIONS;
43+
import static org.apache.hadoop.fs.s3a.Constants.DEFAULT_REQUEST_TIMEOUT_DURATION;
4344
import static org.apache.hadoop.fs.s3a.Constants.DEFAULT_SOCKET_TIMEOUT_DURATION;
4445
import static org.apache.hadoop.fs.s3a.Constants.ESTABLISH_TIMEOUT;
4546
import static org.apache.hadoop.fs.s3a.Constants.MAXIMUM_CONNECTIONS;
@@ -175,6 +176,21 @@ public void testCreateApiConnectionSettings() {
175176
.describedAs("%s in %s", REQUEST_TIMEOUT, settings)
176177
.isEqualTo(Duration.ofHours(1));
177178
}
179+
/**
180+
* Verify that the timeout from {@link org.apache.hadoop.fs.s3a.Constants#DEFAULT_REQUEST_TIMEOUT_DURATION}
181+
* makes it all the way through and that nothing in in core-default or core-site is setting it.
182+
* This test will fail if someone does set it in core-site.xml
183+
*/
184+
@Test
185+
public void testCreateApiConnectionSettingsDefault() {
186+
final Configuration conf = new Configuration();
187+
Assertions.assertThat(conf.get(REQUEST_TIMEOUT))
188+
.describedAs("Request timeout %s", REQUEST_TIMEOUT)
189+
.isNull();
190+
191+
assertDuration(REQUEST_TIMEOUT, DEFAULT_REQUEST_TIMEOUT_DURATION,
192+
createApiConnectionSettings(conf).getApiCallTimeout());
193+
}
178194

179195
/**
180196
* Set a list of keys to the same value.

hadoop-tools/hadoop-aws/src/test/resources/core-site.xml

-5
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,6 @@
201201
<value>true</value>
202202
</property>
203203

204-
<property>
205-
<name>fs.s3a.connection.request.timeout</name>
206-
<value>10s</value>
207-
</property>
208-
209204
<property>
210205
<name>fs.s3a.attempts.maximum</name>
211206
<value>1</value>

0 commit comments

Comments
 (0)