-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
JDKZlibEncoder or JDKZlibDecoder can't work correct with large data #6804
Comments
@lsqlebai can you please provide a full reproducer ? Also please update to latest netty version just to be sure. |
sorry the netty version is 4.1.6.Final |
@normanmaurer What would you want? my project is so large. maybe i can give u a demo when i free. |
@lsqlebai I want you to upgrade to latest 4.1. version and try again if it happens. If it still happens provide me some way to reproduce. |
Ideally folks that file issues will provide a minimal/complete (so we can run it, but don't have to understand your entire application logic) ... the easier it is to reproduce the more likely we will be able to figure out the issue (assuming its a Netty issue) and fix it. |
@Scottmitch @normanmaurer i wrote a demo, how can i give you? by email or??? |
@Scottmitch @normanmaurer would u please try this code: https://github.com/lsqlebai/testzlib |
Motivation: JdkZlibDecoder will allocate a new buffer when the previous buffer is filled with inflated data, but JZlibDecoder will attempt to use the same buffer by resizing. This leads to inconsistent results when these two decoders that are intended to be functionality equivalent. Modifications: - JdkZlibDecoder should attempt to resize and reuse the existing buffer instead of creating multiple buffers Result: Fixes netty#6804
I took a brief look. It seems like the issue is in this case the |
Motivation: JdkZlibDecoder will allocate a new buffer when the previous buffer is filled with inflated data, but JZlibDecoder will attempt to use the same buffer by resizing. This leads to inconsistent results when these two decoders that are intended to be functionality equivalent. Modifications: - JdkZlibDecoder should attempt to resize and reuse the existing buffer instead of creating multiple buffers Result: Fixes #6804
Motivation: JdkZlibDecoder will allocate a new buffer when the previous buffer is filled with inflated data, but JZlibDecoder will attempt to use the same buffer by resizing. This leads to inconsistent results when these two decoders that are intended to be functionality equivalent. Modifications: - JdkZlibDecoder should attempt to resize and reuse the existing buffer instead of creating multiple buffers Result: Fixes netty#6804
Motivation: JdkZlibDecoder will allocate a new buffer when the previous buffer is filled with inflated data, but JZlibDecoder will attempt to use the same buffer by resizing. This leads to inconsistent results when these two decoders that are intended to be functionality equivalent. Modifications: - JdkZlibDecoder should attempt to resize and reuse the existing buffer instead of creating multiple buffers Result: Fixes netty#6804
Motivation: JdkZlibDecoder will allocate a new buffer when the previous buffer is filled with inflated data, but JZlibDecoder will attempt to use the same buffer by resizing. This leads to inconsistent results when these two decoders that are intended to be functionality equivalent. Modifications: - JdkZlibDecoder should attempt to resize and reuse the existing buffer instead of creating multiple buffers Result: Fixes netty#6804
Expected behavior
work
Actual behavior
decode error(protobuf decode error)
Steps to reproduce
i have 2 server. and them communicate with tcp.
and the pipeline init code double with them.
when the send data > 16000 byte (maybe less). the decode side can't correct decode (protobuf decode error).
Minimal yet complete reproducer code (or URL to code)
decode error code:
Code:
i had 2 test:
remove zlib, can be work.like this:
change to the JZlibDecoder and JZlibEncoder can be work. like this:
Netty version
4.1.7
JVM version (e.g.
java -version
)java version "1.8.0_101"
OS version (e.g.
uname -a
)windows
The text was updated successfully, but these errors were encountered: