Skip to content

Commit b1bd682

Browse files
committed
Remove httpRequestTimeout and executionTimeout features
1 parent 9975c1f commit b1bd682

File tree

17 files changed

+39
-180
lines changed

17 files changed

+39
-180
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"category": "AWS SDK for Java v2",
3+
"type": "removal",
4+
"description": "Remove httpRequestTimeout and totalExecutionTimeout features"
5+
}

aws-core/src/test/java/software/amazon/awssdk/awscore/client/config/AwsImmutableClientConfigurationTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ private AwsSyncClientConfiguration initializedSyncConfiguration() {
8787

8888
private ClientOverrideConfiguration initializedOverrideConfiguration() {
8989
return ClientOverrideConfiguration.builder()
90-
.httpRequestTimeout(Duration.ofSeconds(2))
91-
.totalExecutionTimeout(Duration.ofSeconds(4))
9290
.gzipEnabled(true)
9391
.addAdditionalHttpHeader("header", "value")
9492
.advancedOption(AwsAdvancedClientOption.USER_AGENT_PREFIX, "userAgentPrefix")

aws-core/src/test/java/software/amazon/awssdk/awscore/client/utils/HttpTestUtils.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ public AmazonSyncHttpClient build() {
7272
SdkHttpClient sdkHttpClient = this.httpClient != null ? this.httpClient : testSdkHttpClient();
7373
ClientOverrideConfiguration overrideConfiguration =
7474
ClientOverrideConfiguration.builder()
75-
.totalExecutionTimeout(clientExecutionTimeout)
7675
.apply(this::configureRetryPolicy)
7776
.apply(this::configureAdditionalHeaders)
7877
.build();

core/src/it/java/software/amazon/awssdk/core/http/timers/client/AbortedExceptionClientExecutionTimerIntegrationTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@
2929
import java.io.InputStream;
3030
import java.util.Arrays;
3131
import org.junit.Before;
32+
import org.junit.Ignore;
3233
import org.junit.Test;
3334
import org.junit.runner.RunWith;
3435
import org.mockito.Mock;
3536
import org.mockito.runners.MockitoJUnitRunner;
37+
import software.amazon.awssdk.annotations.ReviewBeforeRelease;
3638
import software.amazon.awssdk.core.exception.AbortedException;
3739
import software.amazon.awssdk.core.exception.SdkClientException;
3840
import software.amazon.awssdk.core.http.AmazonSyncHttpClient;
@@ -55,6 +57,8 @@
5557
import utils.HttpTestUtils;
5658

5759
@RunWith(MockitoJUnitRunner.class)
60+
@Ignore
61+
@ReviewBeforeRelease("add it back once execution time out is added back")
5862
public class AbortedExceptionClientExecutionTimerIntegrationTest extends MockServerTestBase {
5963

6064
private AmazonSyncHttpClient httpClient;

core/src/it/java/software/amazon/awssdk/core/http/timers/client/DummyErrorResponseServerIntegrationTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020

2121
import java.util.Collections;
2222
import org.junit.BeforeClass;
23+
import org.junit.Ignore;
2324
import org.junit.Test;
25+
import software.amazon.awssdk.annotations.ReviewBeforeRelease;
2426
import software.amazon.awssdk.core.TestPreConditions;
2527
import software.amazon.awssdk.core.http.AmazonSyncHttpClient;
2628
import software.amazon.awssdk.core.http.ExecutionContext;
@@ -36,6 +38,8 @@
3638
/**
3739
* Tests that use a server that returns a predetermined error response within the timeout limit
3840
*/
41+
@Ignore
42+
@ReviewBeforeRelease("add it back once execution time out is added back")
3943
public class DummyErrorResponseServerIntegrationTests extends MockServerTestBase {
4044

4145
private static final int STATUS_CODE = 500;

core/src/it/java/software/amazon/awssdk/core/http/timers/client/DummySuccessfulResponseServerIntegrationTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
import static software.amazon.awssdk.core.internal.http.timers.TimeoutTestConstants.TEST_TIMEOUT;
2020

2121
import java.util.Arrays;
22+
import org.junit.Ignore;
2223
import org.junit.Test;
24+
import software.amazon.awssdk.annotations.ReviewBeforeRelease;
2325
import software.amazon.awssdk.core.http.AmazonSyncHttpClient;
2426
import software.amazon.awssdk.core.http.ExecutionContext;
2527
import software.amazon.awssdk.core.http.MockServerTestBase;
@@ -31,7 +33,8 @@
3133
import software.amazon.awssdk.core.internal.http.response.DummyResponseHandler;
3234
import software.amazon.awssdk.core.internal.http.response.UnresponsiveResponseHandler;
3335
import utils.HttpTestUtils;
34-
36+
@Ignore
37+
@ReviewBeforeRelease("add it back once execution time out is added back")
3538
public class DummySuccessfulResponseServerIntegrationTests extends MockServerTestBase {
3639

3740
private static final int STATUS_CODE = 200;

core/src/it/java/software/amazon/awssdk/core/http/timers/client/UnresponsiveServerIntegrationTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,24 @@
3030
import java.net.SocketTimeoutException;
3131
import java.time.Duration;
3232
import org.junit.BeforeClass;
33+
import org.junit.Ignore;
3334
import org.junit.Test;
35+
import software.amazon.awssdk.annotations.ReviewBeforeRelease;
3436
import software.amazon.awssdk.core.TestPreConditions;
3537
import software.amazon.awssdk.core.config.ClientOverrideConfiguration;
3638
import software.amazon.awssdk.core.config.SdkMutableClientConfiguration;
3739
import software.amazon.awssdk.core.exception.SdkClientException;
3840
import software.amazon.awssdk.core.http.AmazonSyncHttpClient;
3941
import software.amazon.awssdk.core.http.UnresponsiveMockServerTestBase;
4042
import software.amazon.awssdk.core.http.exception.ClientExecutionTimeoutException;
41-
import software.amazon.awssdk.core.internal.http.timers.TimeoutTestConstants;
4243
import software.amazon.awssdk.core.retry.FixedTimeBackoffStrategy;
4344
import software.amazon.awssdk.core.retry.RetryPolicy;
4445
import software.amazon.awssdk.http.SdkHttpClient;
4546
import software.amazon.awssdk.http.apache.ApacheSdkHttpClientFactory;
4647
import utils.HttpTestUtils;
4748

49+
@Ignore
50+
@ReviewBeforeRelease("Add the tests back once execution, request timeout are added back")
4851
public class UnresponsiveServerIntegrationTests extends UnresponsiveMockServerTestBase {
4952

5053
private static final Duration LONGER_SOCKET_TIMEOUT =
@@ -90,7 +93,6 @@ public void interruptCausedBySomethingOtherThanTimer_PropagatesInterruptToCaller
9093

9194
ClientOverrideConfiguration overrideConfiguration =
9295
ClientOverrideConfiguration.builder()
93-
.totalExecutionTimeout(TimeoutTestConstants.CLIENT_EXECUTION_TIMEOUT)
9496
.retryPolicy(retryPolicy)
9597
.build();
9698

core/src/main/java/software/amazon/awssdk/core/RequestOverrideConfig.java

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,11 @@ public abstract class RequestOverrideConfig {
3737

3838
private final Map<String, List<String>> rawQueryParameters;
3939

40-
private final Duration requestExecutionTimeout;
41-
4240
private final List<ApiName> apiNames;
4341

4442
protected RequestOverrideConfig(Builder<?> builder) {
4543
this.headers = builder.headers();
4644
this.rawQueryParameters = builder.rawQueryParameters();
47-
this.requestExecutionTimeout = builder.requestExecutionTimeout();
4845
this.apiNames = builder.apiNames();
4946
}
5047

@@ -66,15 +63,6 @@ public Optional<Map<String, List<String>>> rawQueryParameters() {
6663
return Optional.ofNullable(rawQueryParameters);
6764
}
6865

69-
/**
70-
* Optional execution timeout for the request.
71-
*
72-
* @return The optional execution timeout.
73-
*/
74-
public Optional<Duration> requestExecutionTimeout() {
75-
return Optional.ofNullable(requestExecutionTimeout);
76-
}
77-
7866
/**
7967
* The optional names of the higher level libraries that constructed the request.
8068
*
@@ -170,22 +158,6 @@ default B rawQueryParameter(String name, String value) {
170158
*/
171159
B rawQueryParameters(Map<String, List<String>> rawQueryParameters);
172160

173-
/**
174-
* Optional execution timeout for the request.
175-
*
176-
* @return The optional execution timeout.
177-
*/
178-
Duration requestExecutionTimeout();
179-
180-
/**
181-
* Set an optional execution timeout for the request.
182-
*
183-
* @param requestExecutionTimeout The optional execution timeout for the request.
184-
*
185-
* @return This object for method chaining.
186-
*/
187-
B requestExecutionTimeout(Duration requestExecutionTimeout);
188-
189161
/**
190162
* The optional names of the higher level libraries that constructed the request.
191163
*
@@ -234,7 +206,6 @@ protected BuilderImpl() {
234206
protected BuilderImpl(RequestOverrideConfig sdkRequestOverrideConfig) {
235207
sdkRequestOverrideConfig.headers().ifPresent(this::headers);
236208
sdkRequestOverrideConfig.rawQueryParameters().ifPresent(this::rawQueryParameters);
237-
sdkRequestOverrideConfig.requestExecutionTimeout().ifPresent(this::requestExecutionTimeout);
238209
sdkRequestOverrideConfig.apiNames().ifPresent(apiNames -> apiNames.forEach(this::addApiName));
239210
}
240211

@@ -288,18 +259,6 @@ public B rawQueryParameters(Map<String, List<String>> rawQueryParameters) {
288259
return (B) this;
289260
}
290261

291-
@Override
292-
public Duration requestExecutionTimeout() {
293-
return requestExecutionTimeout;
294-
}
295-
296-
@Override
297-
@SuppressWarnings("unchecked")
298-
public B requestExecutionTimeout(Duration requestExecutionTimeout) {
299-
this.requestExecutionTimeout = requestExecutionTimeout;
300-
return (B) this;
301-
}
302-
303262
@Override
304263
public List<ApiName> apiNames() {
305264
return apiNames;

core/src/main/java/software/amazon/awssdk/core/config/ClientOverrideConfiguration.java

Lines changed: 1 addition & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515

1616
package software.amazon.awssdk.core.config;
1717

18-
import java.time.Duration;
1918
import java.util.ArrayList;
2019
import java.util.Collections;
2120
import java.util.HashMap;
2221
import java.util.List;
2322
import java.util.Map;
2423
import java.util.function.Consumer;
25-
import software.amazon.awssdk.annotations.ReviewBeforeRelease;
2624
import software.amazon.awssdk.annotations.SdkInternalApi;
2725
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
2826
import software.amazon.awssdk.core.retry.RetryPolicy;
@@ -39,9 +37,7 @@
3937
* <p>Use {@link #builder()} to create a set of options.</p>
4038
*/
4139
public class ClientOverrideConfiguration
42-
implements ToCopyableBuilder<ClientOverrideConfiguration.Builder, ClientOverrideConfiguration> {
43-
private final Duration httpRequestTimeout;
44-
private final Duration totalExecutionTimeout;
40+
implements ToCopyableBuilder<ClientOverrideConfiguration.Builder, ClientOverrideConfiguration> {
4541
private final Map<String, List<String>> additionalHttpHeaders;
4642
private final Boolean gzipEnabled;
4743
private final RetryPolicy retryPolicy;
@@ -52,8 +48,6 @@ public class ClientOverrideConfiguration
5248
* Initialize this configuration. Private to require use of {@link #builder()}.
5349
*/
5450
private ClientOverrideConfiguration(DefaultClientOverrideConfigurationBuilder builder) {
55-
this.httpRequestTimeout = builder.httpRequestTimeout;
56-
this.totalExecutionTimeout = builder.totalExecutionTimeout;
5751
this.additionalHttpHeaders = CollectionUtils.deepUnmodifiableMap(builder.additionalHttpHeaders);
5852
this.gzipEnabled = builder.gzipEnabled;
5953
this.retryPolicy = builder.retryPolicy;
@@ -64,8 +58,6 @@ private ClientOverrideConfiguration(DefaultClientOverrideConfigurationBuilder bu
6458
@Override
6559
public Builder toBuilder() {
6660
return new DefaultClientOverrideConfigurationBuilder().advancedOptions(advancedOptions.toBuilder())
67-
.httpRequestTimeout(httpRequestTimeout)
68-
.totalExecutionTimeout(totalExecutionTimeout)
6961
.additionalHttpHeaders(additionalHttpHeaders)
7062
.gzipEnabled(gzipEnabled)
7163
.retryPolicy(retryPolicy)
@@ -79,49 +71,6 @@ public static Builder builder() {
7971
return new DefaultClientOverrideConfigurationBuilder();
8072
}
8173

82-
/**
83-
* The amount of time to wait for the request to complete before giving up and timing out. An empty value disables this
84-
* feature.
85-
*
86-
* <p>This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout when
87-
* reading the response. For APIs that return large responses this could be expensive.</p>
88-
*
89-
* <p>The request timeout feature doesn't have strict guarantees on how quickly a request is aborted when the timeout is
90-
* breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that don't
91-
* get aborted until several seconds after the timer has been breached. Because of this, the request timeout feature should
92-
* not be used when absolute precision is needed.</p>
93-
*
94-
* @see Builder#httpRequestTimeout(Duration)
95-
*/
96-
@ReviewBeforeRelease("This doesn't currently work.")
97-
public Duration httpRequestTimeout() {
98-
return httpRequestTimeout;
99-
}
100-
101-
/**
102-
* The amount of time to allow the client to complete the execution of an API call. This timeout covers the entire client
103-
* execution except for marshalling. This includes request handler execution, all HTTP requests including retries,
104-
* unmarshalling, etc. An empty value disables this feature.
105-
*
106-
* <p>This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout when
107-
* reading the response. For APIs that return large responses this could be expensive.</p>
108-
*
109-
* <p>The client execution timeout feature doesn't have strict guarantees on how quickly a request is aborted when the
110-
* timeout
111-
* is breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that
112-
* don't get aborted until several seconds after the timer has been breached. Because of this, the client execution timeout
113-
* feature should not be used when absolute precision is needed.</p>
114-
*
115-
* <p>This may be used together with {@link #httpRequestTimeout()} to enforce both a timeout on each individual HTTP request
116-
* (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'client execution' time). A
117-
* non-positive value disables this feature.</p>
118-
*
119-
* @see Builder#totalExecutionTimeout(Duration)
120-
*/
121-
public Duration totalExecutionTimeout() {
122-
return totalExecutionTimeout;
123-
}
124-
12574
/**
12675
* An unmodifiable representation of the set of HTTP headers that should be sent with every request. If not set, this will
12776
* return an empty map.
@@ -173,8 +122,6 @@ public List<ExecutionInterceptor> executionInterceptors() {
173122
@Override
174123
public String toString() {
175124
return ToString.builder("ClientOverrideConfiguration")
176-
.add("httpRequestTimeout", httpRequestTimeout)
177-
.add("totalExecutionTimeout", totalExecutionTimeout)
178125
.add("additionalHttpHeaders", additionalHttpHeaders)
179126
.add("gzipEnabled", gzipEnabled)
180127
.add("retryPolicy", retryPolicy)
@@ -189,43 +136,6 @@ public String toString() {
189136
* <p>All implementations of this interface are mutable and not thread safe.</p>
190137
*/
191138
public interface Builder extends CopyableBuilder<Builder, ClientOverrideConfiguration> {
192-
/**
193-
* Configure the amount of time to wait for the request to complete before giving up and timing out. A non-positive value
194-
* disables this feature.
195-
*
196-
* <p>This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout
197-
* when reading the response. For APIs that return large responses this could be expensive.</p>
198-
*
199-
* <p>The request timeout feature doesn't have strict guarantees on how quickly a request is aborted when the timeout is
200-
* breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that
201-
* don't get aborted until several seconds after the timer has been breached. Because of this, the request timeout
202-
* feature
203-
* should not be used when absolute precision is needed.</p>
204-
*
205-
* @see ClientOverrideConfiguration#httpRequestTimeout()
206-
*/
207-
Builder httpRequestTimeout(Duration httpRequestTimeout);
208-
209-
/**
210-
* Configure the amount of time to allow the client to complete the execution of an API call. This timeout covers the
211-
* entire client execution except for marshalling. This includes request handler execution, all HTTP request including
212-
* retries, unmarshalling, etc.
213-
*
214-
* <p>This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout
215-
* when reading the response. For APIs that return large responses this could be expensive.</p>
216-
*
217-
* <p>The client execution timeout feature doesn't have strict guarantees on how quickly a request is aborted when the
218-
* timeout is breached. The typical case aborts the request within a few milliseconds but there may occasionally be
219-
* requests that don't get aborted until several seconds after the timer has been breached. Because of this, the client
220-
* execution timeout feature should not be used when absolute precision is needed.</p>
221-
*
222-
* <p>This may be used together with {@link #httpRequestTimeout()} to enforce both a timeout on each individual HTTP
223-
* request (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'client execution' time).
224-
* A non-positive value disables this feature.</p>
225-
*
226-
* @see ClientOverrideConfiguration#totalExecutionTimeout()
227-
*/
228-
Builder totalExecutionTimeout(Duration totalExecutionTimeout);
229139

230140
/**
231141
* Define a set of headers that should be added to every HTTP request sent to AWS. This will override any headers
@@ -322,34 +232,12 @@ default Builder retryPolicy(Consumer<RetryPolicy.Builder> retryPolicy) {
322232
* An SDK-internal implementation of {@link ClientOverrideConfiguration.Builder}.
323233
*/
324234
private static final class DefaultClientOverrideConfigurationBuilder implements Builder {
325-
private Duration httpRequestTimeout;
326-
private Duration totalExecutionTimeout;
327235
private Map<String, List<String>> additionalHttpHeaders = new HashMap<>();
328236
private Boolean gzipEnabled;
329237
private RetryPolicy retryPolicy;
330238
private List<ExecutionInterceptor> executionInterceptors = new ArrayList<>();
331239
private AttributeMap.Builder advancedOptions = AttributeMap.builder();
332240

333-
@Override
334-
public Builder httpRequestTimeout(Duration httpRequestTimeout) {
335-
this.httpRequestTimeout = httpRequestTimeout;
336-
return this;
337-
}
338-
339-
public void setHttpRequestTimeout(Duration httpRequestTimeout) {
340-
httpRequestTimeout(httpRequestTimeout);
341-
}
342-
343-
@Override
344-
public Builder totalExecutionTimeout(Duration totalExecutionTimeout) {
345-
this.totalExecutionTimeout = totalExecutionTimeout;
346-
return this;
347-
}
348-
349-
public void setTotalExecutionTimeout(Duration totalExecutionTimeout) {
350-
totalExecutionTimeout(totalExecutionTimeout);
351-
}
352-
353241
@Override
354242
public Builder additionalHttpHeaders(Map<String, List<String>> additionalHttpHeaders) {
355243
this.additionalHttpHeaders = CollectionUtils.deepCopyMap(additionalHttpHeaders);

0 commit comments

Comments
 (0)