Skip to content

Commit 8a6815a

Browse files
committed
HADOOP-19045. CreateSession Timeout - followup
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 Change-Id: I89761bf4d554c671786cedac3c3fb4215a863964
1 parent 5ad7737 commit 8a6815a

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

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

Lines changed: 0 additions & 14 deletions
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/test/java/org/apache/hadoop/fs/s3a/impl/TestAwsClientConfig.java

Lines changed: 16 additions & 0 deletions
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

Lines changed: 0 additions & 5 deletions
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)