Skip to content

Add apiCallAttempt timeout and apiCall timeout feature for asynchrounous operations #657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/next-release/feature-AWSSDKforJavav2-bd6fe1d.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"category": "AWS SDK for Java v2",
"type": "feature",
"description": "Implement apiCallAttemptTimeout and apiCallTimeout feature for asynchrounous calls. Customers can specify timeout via `ClientOverrideConfiguaration.Builder#apiCallTimeout(Duration)` or `RequestOverrideConfiguration.Builder#apiCallAttemptTimeout(Duration)`. Note: this feature is only implemented for asynchrounous api calls."
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static SdkClientConfiguration testClientConfiguration() {
.option(SdkAdvancedClientOption.USER_AGENT_PREFIX, "")
.option(SdkAdvancedClientOption.USER_AGENT_SUFFIX, "")
.option(SdkAdvancedAsyncClientOption.FUTURE_COMPLETION_EXECUTOR, Runnable::run)
.option(SdkClientOption.ASYNC_RETRY_EXECUTOR_SERVICE, Executors.newScheduledThreadPool(1))
.option(SdkClientOption.SCHEDULED_EXECUTOR_SERVICE, Executors.newScheduledThreadPool(1))
.build();
}

Expand Down
6 changes: 6 additions & 0 deletions core/sdk-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@
<artifactId>hamcrest-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>netty-nio-client</artifactId>
<version>${awsjavasdk.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.mockito.runners.MockitoJUnitRunner;
import software.amazon.awssdk.annotations.ReviewBeforeRelease;
import software.amazon.awssdk.core.exception.AbortedException;
import software.amazon.awssdk.core.exception.ClientExecutionTimeoutException;
import software.amazon.awssdk.core.exception.ApiCallTimeoutException;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.ExecutionContext;
import software.amazon.awssdk.core.http.MockServerTestBase;
Expand Down Expand Up @@ -90,7 +90,7 @@ public void clientExecutionTimeoutEnabled_aborted_exception_occurs_timeout_not_e
execute(httpClient, createMockGetRequest());
}

@Test(expected = ClientExecutionTimeoutException.class)
@Test(expected = ApiCallTimeoutException.class)
public void clientExecutionTimeoutEnabled_aborted_exception_occurs_timeout_expired() throws Exception {
// Simulate a slow HTTP request
when(abortableCallable.call()).thenAnswer(i -> {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading