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
Cannot download a large file using RESTEasy Reactive #22218
Labels
Milestone
Comments
/cc @FroMage, @geoand, @stuartwdouglas |
stuartwdouglas
added a commit
to stuartwdouglas/quarkus
that referenced
this issue
Dec 15, 2021
This makes it possible to download large files, however it is still slower than the static resource handler. Even when using Vert.x AsyncFile it is still slower than the built in Vertx handler, so more work on performance is required here. Fixes quarkusio#22218
stuartwdouglas
added a commit
to stuartwdouglas/quarkus
that referenced
this issue
Dec 15, 2021
This makes it possible to download large files, however it is still slower than the static resource handler. Even when using Vert.x AsyncFile it is still slower than the built in Vertx handler, so more work on performance is required here. Fixes quarkusio#22218
stuartwdouglas
added a commit
to stuartwdouglas/quarkus
that referenced
this issue
Dec 15, 2021
This makes it possible to download large files, however it is still slower than the static resource handler. Fixes quarkusio#22218
stuartwdouglas
added a commit
to stuartwdouglas/quarkus
that referenced
this issue
Dec 15, 2021
This makes it possible to download large files. Fixes quarkusio#22218
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I recently switched to resteasy-reactive for my application, and I'm now unable to download large files.
If I try to create a response with the following syntax:
It fails for files larger than 2GB because it tries to buffer them but it is not possible to instantiate a ByteArrayOutputStream larger than MAX_INT (there is basically an integer overflow when calling the constructor and I end up with
Request failed: java.lang.IllegalArgumentException: Negative initial size
).When I try to pass a FileInputStream as the response entity, it does work but my application maxes one of my CPU core during the download, and if the download gets interrupted the inputstream is never closed.
Expected behavior
It should be possible to send large files as response entities using resteasy-reactive without maxing CPU usage.
Actual behavior
Using a File type leads to integer overflow when instantiating the response outputstream, using an inputstream maxes a CPU core and never closes the file descriptor if interrupted.
How to Reproduce?
Output of
uname -a
orver
Linux 5.13.13-arch1-1 #1 SMP PREEMPT Thu, 26 Aug 2021 19:14:36 +0000 x86_64 GNU/Linux
Output of
java -version
openjdk 11.0.12 2021-07-20
GraalVM version (if different from Java)
GraalVM 21.3.0 Java 11 CE (Java Version 11.0.13+7-jvmci-21.3-b05)
Quarkus version or git rev
2.5.1.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Additional information
No response
The text was updated successfully, but these errors were encountered: