Skip to content
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

Fixed an issue in S3 client where a GetObject request m… #5977

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

zoewangg
Copy link
Contributor

@zoewangg zoewangg commented Mar 20, 2025

…ay hang if streaming failed mid request

Motivation and Context

May be related to #5755

Modifications

Fixed an issue in AWS CRT-based S3 client where a GetObject request may hang if streaming failed mid request.

In the AWS CRT-based S3 client, if there is an I/O error thrown, we notify the response handler through responseHandler#onError. When AsyncResponseTransformer#toBlockingInputStream is used, it just completed the future exceptionally and doesn't send error to the underlying subscriber
https://github.com/aws/aws-sdk-java-v2/blob/master/core/sdk-core/src/main/java/software/amazon/awssdk/core/internal/async/InputStreamResponseTransformer.java#L60

Testing

Added unit tests and verified through smoke tests (turning off wifi mid streaming to simulate the error)

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@zoewangg zoewangg changed the title Fixed an issue in AWS CRT-based S3 client where a GetObject request m… Fixed an issue in S3 client where a GetObject request m… Mar 20, 2025
@zoewangg zoewangg force-pushed the zoewang/s3crtclient-fix branch from 09c6ef5 to 4f0e173 Compare March 26, 2025 23:16
@zoewangg zoewangg marked this pull request as ready for review March 26, 2025 23:41
@zoewangg zoewangg requested a review from a team as a code owner March 26, 2025 23:41
@zoewangg zoewangg force-pushed the zoewang/s3crtclient-fix branch from 4f0e173 to 023f74c Compare March 27, 2025 17:05
@zoewangg zoewangg force-pushed the zoewang/s3crtclient-fix branch from 023f74c to ae30c8c Compare March 27, 2025 17:10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my understanding, why are we changing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was automatically updated after I ran mvn package. It basically means the suppressions are no longer needed. It could be that we fixed the violations or simply removed the code that had the violations

@@ -48,7 +48,8 @@ public class CodingConventionWithSuppressionTest {
private static final Set<Pattern> ALLOWED_WARN_LOG_SUPPRESSION = new HashSet<>(
Arrays.asList(ArchUtils.classNameToPattern(EmfMetricLoggingPublisher.class),
ArchUtils.classNameToPattern(MetricEmfConverter.class),
ArchUtils.classNameToPattern(MakeHttpRequestStage.class)));
ArchUtils.classNameToPattern(MakeHttpRequestStage.class),
ArchUtils.classNameToPattern("software.amazon.awssdk.services.s3.internal.crt.S3CrtResponseHandlerAdapter")));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing S3CrtResponseHandlerAdapter.class does not work because it'd try to load CRT classes and fail and we don't want to include CRT dependency in our arch tests

@zoewangg zoewangg added this pull request to the merge queue Mar 27, 2025
Merged via the queue into master with commit 0b5dc7d Mar 27, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants