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

JVM Crash: Fatal Error - Issue with Native Method s3ClientMakeMetaRequest in S3Client #716

Closed
kcsurapaneni opened this issue Nov 12, 2023 · 0 comments
Labels
bug This issue is a bug. needs-review This issue or pull request needs review from a core team member. p2 This is a standard priority issue

Comments

@kcsurapaneni
Copy link

Describe the bug

Encountered a fatal error when creating an S3AsyncClient, configuring it, closing it immediately, and then attempting to perform an asynchronous putObject operation. The crash is triggered, resulting in a JVM crash.

Expected Behavior

Should gracefully handle the scenario where a putObject operation is attempted on a closed S3AsyncClient without causing a fatal error in the JVM.

Current Behavior

The JVM crashes with an error in the native method software.amazon.awssdk.crt.s3.S3Client.s3ClientMakeMetaRequest when attempting to perform a putObject operation on a S3AsyncClient that has been closed.

Reproduction Steps

  1. Creates an asynchronous S3AsyncClient with specific configuration settings.
  2. Creates a PutObjectRequest specifying the destination bucket and key for the S3 object.
  3. Explicitly close the S3AsyncClient immediately after creation.
  4. Attempt to asynchronously upload an object to S3 using the closed S3AsyncClient.

Observe the JVM crash and review the logs here in the sample project (https://github.com/kcsurapaneni/java-aws-sdk) available on GitHub for detailed information.

Possible Solution

Ensure that the library gracefully handles scenarios where operations are attempted on a closed client.

Additional Information/Context

Relevant code snippet

S3AsyncClient s3 = S3AsyncClient.crtBuilder()
                .region(Region.US_WEST_2)
                .targetThroughputInGbps(100.0)
                .minimumPartSizeInBytes(8 * MB)
                .build();

PutObjectRequest putOb = PutObjectRequest.builder()
                .bucket("temp-bucket")
                .key("uploads")
                .build();

s3.close();

CompletableFuture<PutObjectResponse> putObjectResponseCompletableFuture = s3.putObject(putOb, AsyncRequestBody.fromBytes("byteArr".getBytes()));

aws-crt-java version used

0.28.6

Java version used

1.8(Amazon Coretto), 17(Oracle, Zulu, Amazon Coretto)

Operating System and version

macOS 14.1

@kcsurapaneni kcsurapaneni added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 12, 2023
@jmklix jmklix self-assigned this Nov 15, 2023
@jmklix jmklix added investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Nov 15, 2023
@waahm7 waahm7 added needs-review This issue or pull request needs review from a core team member. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Nov 22, 2023
@jmklix jmklix removed their assignment Nov 29, 2023
@waahm7 waahm7 closed this as completed Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-review This issue or pull request needs review from a core team member. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

3 participants