minio / minio-java

MinIO Client SDK for Java
https://docs.min.io/docs/java-client-quickstart-guide.html
Apache License 2.0
1.12k stars 484 forks source link

minio multipart upload throws an exception, but sdk donot catch and throws it #1594

Open goyjy opened 11 hours ago

goyjy commented 11 hours ago

【version】 minio version:RELEASE.2023-01-31T02-24-19Z minio-java version:8.4.3

【description】 When I did a multipart upload, the multipart upload failed because the bucket's quota was exceeded, but the client did not catch the exception.

minio trace logs image

reason for error is "Bucket quota exceeded"

Looking at the source code, we found that when the multipart upload fails, the abortMultipartUploadAsync method needs to be executed, so the multipart upload error will not be thrown. image

【expectation】 Error message for multipart upload failure can be thrown

balamurugana commented 11 hours ago

What error does the server throw to the client? If the server sends success, nothing can be done at client side.

klauspost commented 11 hours ago

@balamurugana Server sent 400 on PutObjectPart. This was caught by the client, which then called AbortMultipartUpload.

It seems like successfully aborting swallows the original issue, right?

goyjy commented 11 hours ago

What error does the server throw to the client? If the server sends success, nothing can be done at client side.

The process is like this: 1、Java sdk upload object parts; 2、The minio server returned error code 400 because "Bucket quota exceeded"; 3、Java sdk catch the server-side error and executes the abortMultipartUploadAsync method; 4、The abortMultipartUploadAsync method executes successfully and returns,But the "Bucket quota exceeded" error is not thrown upward.

When I call java sdk to do multipart upload, java sdk returns success. But in fact the object was not uploaded successfully

balamurugana commented 11 hours ago

Actually you are not getting exception in this case, but getting null response. Will send a fix