minio / minio-java

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

Blocking problem of the download method in Java SDK. #1590

Closed ztgoto closed 3 weeks ago

ztgoto commented 3 weeks ago

When the file to be downloaded does not exist (404) in the Java SDK, the download method(#getObject #downloadObject) will be blocked all the time instead of throwing an exception to interrupt the download method. I don't know if there's something wrong with my usage or some other issues. I hope that the method can return quickly when the file to be downloaded does not exist, rather than being blocked all the time.

sdk version: 8.5.13

harshavardhana commented 3 weeks ago

When the file to be downloaded does not exist (404) in the Java SDK, the download method(#getObject #downloadObject) will be blocked all the time instead of throwing an exception to interrupt the download method. I don't know if there's something wrong with my usage or some other issues. I hope that the method can return quickly when the file to be downloaded does not exist, rather than being blocked all the time.

blocked on what? please provide a reproducer and also who is your S3 provider?

ztgoto commented 3 weeks ago

When the file to be downloaded does not exist (404) in the Java SDK, the download method(#getObject #downloadObject) will be blocked all the time instead of throwing an exception to interrupt the download method. I don't know if there's something wrong with my usage or some other issues. I hope that the method can return quickly when the file to be downloaded does not exist, rather than being blocked all the time.

blocked on what? please provide a reproducer and also who is your S3 provider?

I use a Minio server deployed with Docker. When the Java SDK attempts to download a non - existent file, the console has already printed the HTTP 404 - related response, but the download method remains blocked all the time. The JDK 1.8 is used in my demo.

response={code=404, headers=Accept-Ranges: bytes
Content-Length: 352
Content-Type: application/xml
Server: MinIO
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Origin
Vary: Accept-Encoding
X-Amz-Id-2: 36434b1fe4c7845506a8b1cdac714a3e459d63fe7ce26b1d5f15ec9c91be4b34
X-Amz-Request-Id: 18050C19975E43C8
X-Content-Type-Options: nosniff
X-Ratelimit-Limit: 5100
X-Ratelimit-Remaining: 5100
X-Xss-Protection: 1; mode=block
Date: Tue, 05 Nov 2024 10:35:35 GMT
}

    at io.minio.S3Base$1.onResponse(S3Base.java:775)
    at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
balamurugana commented 3 weeks ago

Duplicate of https://github.com/minio/minio-java/issues/1431