-
-
Notifications
You must be signed in to change notification settings - Fork 16k
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
Fix exception if Response has content #11093
Conversation
@normanmaurer in the pass through case the message is added to out without being retained: https://github.com/netty/netty/blob/12fbc8320fb935ed7a8de08729de9bc41aadfdbf/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentEncoder.java#L146 but then when it runs the PASS_THROUGH branch it is added again and is retained: Is it intentional to have the same object in the out list twice? |
I am not sure how these failures could be related, is this a known issue? |
@stuartwdouglas imho have the same object in the out list twice is not expected |
@stuartwdouglas yeah these failures are not related... not sure yet why these popped up. |
If compression is enabled and the HttpResponse also implements HttpContent (but not LastHttpContent) then the buffer will be freed to eagerly. Fixes netty#11092
Turns out I misread the code. I think it is fine, and there is no need to retain it because if it is pass through there is no body anyway. |
@stuartwdouglas ok... so you say this PR is ready to go then ? |
Yes, it is good to go. |
The test failure is fixed by #11102 and not related |
Motivation: If compression is enabled and the HttpResponse also implements HttpContent (but not LastHttpContent) then the buffer will be freed to eagerly. Modification: I retain the buffer the same way that is done for the LastHttpContent case. Note that there is another suspicious looking call a few lines above (if beginEncode returns null). I am not sure if this should also be retained. Result: Fixes #11092
@stuartwdouglas thanks a lot |
Motivation: If compression is enabled and the HttpResponse also implements HttpContent (but not LastHttpContent) then the buffer will be freed to eagerly. Modification: I retain the buffer the same way that is done for the LastHttpContent case. Note that there is another suspicious looking call a few lines above (if beginEncode returns null). I am not sure if this should also be retained. Result: Fixes netty#11092
Motivation:
If compression is enabled and the HttpResponse also
implements HttpContent (but not LastHttpContent) then
the buffer will be freed to eagerly.
Modification:
I retain the buffer the same way that is done for the LastHttpContent case.
Note that there is another suspicious looking call a few lines above (if beginEncode returns null). I am not sure if this should also be retained.
Result:
Fixes #11092