-
Notifications
You must be signed in to change notification settings - Fork 352
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 GET entities > 2GB using jdk-connector #5470
Comments
So you use a buffered entity, you buffer over 2GB of data to memory and then you send them to the client. Do I understand the issue correctly? |
Note that for large files, chunked encoding is far better than a buffered stream. Use |
@jansupol Thanks for the fix, sorry for the radio silence at the time - This this issue was related to the jax-rs response entity, rather than the request entity - not sure it's possible to force the API we're using to use chunked encoding in its response. But your point stands and I did end up using that for file uploads 👍 We were not reading the file in to a buffer, we were just proxying it back to a client with something like |
It's a bit hard for me to produce a minimal failing test case but I can show you exactly where the problem is.
I am forwarding some large files from openstack swift via jetty, jax-rs-client and the jdk-connector (because the performance seems way way better for big files)
In
org.glassfish.jersey.jdk.connector.internal.HttpParser
there's a method calleddecideTransferEncoding
where it expects the content length to parse as an int. This fails when the response size is greater thanInteger.MAX_VALUE
. There might be more issues with this further on down the line, but this was the first one I hit. If I get some time I'll try and get you a patch, but for now I'm going to try and work around it.The text was updated successfully, but these errors were encountered: