Skip to content

Commit 17a0463

Browse files
authored
Merge branch 'master' into alexwoo/eventstream-shared-customization
2 parents d4b1646 + 1802a04 commit 17a0463

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "documentation",
3+
"category": "AWS SDK for Java v2",
4+
"contributor": "",
5+
"description": "Improve EventStreamResponseHandler.Builder.onError method to mention the callback may be called multiple time, similarly to the exceptionOccurred method"
6+
}

.github/workflows/s3-regression-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ jobs:
2222
- name: Check for changes related to s3
2323
id: check-changes
2424
run: |
25-
git fetch origin ${{ github.base_ref || github.event.merge_group.base_ref || github.ref }} --depth 1
26-
CHANGED_FILES=$(git diff remotes/origin/${{ github.base_ref || github.event.merge_group.base_ref || github.ref }} --name-only)
25+
BASE_REF=${{ github.base_ref || github.event.merge_group.base_ref || github.ref }}
26+
BASE_REF=${BASE_REF#refs/heads/}
27+
git fetch origin "$BASE_REF" --depth 1
28+
CHANGED_FILES=$(git diff origin/"$BASE_REF" --name-only)
2729
if echo "$CHANGED_FILES" | grep -q -E '^core/|^services/s3/|^services-custom/s3-transfer-manager/|^http-client-spi/|^http-clients/'; then
2830
echo "Detected changes in S3, HTTP client, or core modules"
2931
echo "has_s3_related_changes=true" >> $GITHUB_OUTPUT

core/aws-core/src/main/java/software/amazon/awssdk/awscore/eventstream/EventStreamResponseHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ interface Builder<ResponseT, EventT, SubBuilderT> {
9494
SubBuilderT onResponse(Consumer<ResponseT> responseConsumer);
9595

9696
/**
97-
* Callback to invoke in the event on an error.
97+
* Callback to invoke in the event on an error. The {@link Consumer#accept(Object)} method may be called multiple times
98+
* during the lifecycle of a request if automatic retries are enabled.
9899
*
99100
* @param consumer Callback that will process any error that occurs.
100101
* @return This builder for method chaining.

services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3IntegrationTestBase.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public static void setUpForAllIntegTests() throws Exception {
7474
s3CrtAsync = S3CrtAsyncClient.builder()
7575
.credentialsProvider(CREDENTIALS_PROVIDER_CHAIN)
7676
.region(DEFAULT_REGION)
77+
.maxConcurrency(1)
7778
.build();
7879
tmCrt = S3TransferManager.builder()
7980
.s3Client(s3CrtAsync)

services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerDownloadPauseResumeIntegrationTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public class S3TransferManagerDownloadPauseResumeIntegrationTest extends S3Integ
5656
private static final Logger log = Logger.loggerFor(S3TransferManagerDownloadPauseResumeIntegrationTest.class);
5757
private static final String BUCKET = temporaryBucketName(S3TransferManagerDownloadPauseResumeIntegrationTest.class);
5858
private static final String KEY = "key";
59-
// 24 * MB is chosen to make sure we have data written in the file already upon pausing.
60-
private static final long OBJ_SIZE = 24 * MB;
59+
// 50 * MB is chosen to make sure we have data written in the file already upon pausing.
60+
private static final long OBJ_SIZE = 50 * MB;
6161
private static File sourceFile;
6262

6363
@BeforeAll
@@ -152,8 +152,7 @@ void pauseAndResume_ObjectNotChanged_shouldResumeDownload(S3TransferManager tm)
152152
assertThat(resumableFileDownload.s3ObjectLastModified()).hasValue(testDownloadListener.getObjectResponse.lastModified());
153153
assertThat(bytesTransferred).isEqualTo(path.toFile().length());
154154
assertThat(resumableFileDownload.totalSizeInBytes()).hasValue(sourceFile.length());
155-
156-
assertThat(bytesTransferred).isLessThan(sourceFile.length());
155+
assertThat(bytesTransferred).isLessThanOrEqualTo(sourceFile.length());
157156
assertThat(download.completionFuture()).isCancelled();
158157

159158
log.debug(() -> "Resuming download ");
@@ -242,7 +241,7 @@ private static void waitUntilFirstByteBufferDelivered(FileDownload download) {
242241
.addAcceptor(WaiterAcceptor.retryOnResponseAcceptor(r -> true))
243242
.overrideConfiguration(o -> o.waitTimeout(Duration.ofMinutes(1))
244243
.maxAttempts(Integer.MAX_VALUE)
245-
.backoffStrategy(FixedDelayBackoffStrategy.create(Duration.ofMillis(100))))
244+
.backoffStrategy(FixedDelayBackoffStrategy.create(Duration.ofMillis(10))))
246245
.build();
247246
waiter.run(() -> download.progress().snapshot());
248247
}

services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/UploadDirectoryHelperTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ void uploadDirectory_customMaxConcurrency_shouldLimitConcurrentOperations() thro
561561
assertThat(observedPeak)
562562
.as("Implementation allowed %d concurrent operations but was configured for %d",
563563
observedPeak, configuredMaxConcurrency)
564-
.isEqualTo(configuredMaxConcurrency);
564+
.isLessThanOrEqualTo(configuredMaxConcurrency);
565565

566566
// Release the phase to let operations complete
567567
phaser.arriveAndDeregister();

0 commit comments

Comments
 (0)