-
Notifications
You must be signed in to change notification settings - Fork 977
Description
Describe the bug
When using the CRT-based S3 client (S3AsyncClient.crtCreate()) with S3TransferManager.upload() and AsyncRequestBody.fromPublisher(), if the publisher emits an error, the exception appears on AwsEventLoop threads (triggering the JVM's default uncaught exception handler).
The error is also correctly propagated to the CompletableFuture, so our application handles it fine. However, the stderr output is unexpected.
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
We would expect the exception to only propagate to the CompletableFuture, without being thrown on event loop threads.
Current Behavior
The exception is:
- Correctly propagated to the
CompletableFuture - Also appears as an uncaught exception on
AwsEventLoopthreads
Stderr output:
Exception in thread "AwsEventLoop6" java.lang.IllegalArgumentException: test error
at ...
Reproduction Steps
Using the CRT-based S3 client and Reactor Flux as the Publisher implementation:
val s3Client = S3AsyncClient.crtCreate()
val s3TransferManager = S3TransferManager.builder()
.s3Client(s3Client)
.build()
val flux: Flux<ByteBuffer> = Flux.error(IllegalArgumentException("test error"))
val result = s3TransferManager
.upload { builder ->
builder
.requestBody(AsyncRequestBody.fromPublisher(flux))
.putObjectRequest { it.bucket("my-bucket").key("my-key") }
}
.completionFuture()
assertFailsWith<CompletionException> {
result.join() // Error is propagated correctly
}
// Stderr shows: "Exception in thread "AwsEventLoop6" java.lang.IllegalArgumentException: test error"We observed that this does not happen with the Netty-based client (S3AsyncClient.builder().build()).
Possible Solution
No response
Additional Information/Context
No response
AWS Java SDK version used
2.41.22 + aws-crt 0.43.1
JDK version used
21
Operating System and version
macOS Tahoe 16.2