-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Suggests to dispose connection when cancelled In NettyWriteResponseFilter #3611
base: main
Are you sure you want to change the base?
Suggests to dispose connection when cancelled In NettyWriteResponseFilter #3611
Conversation
c813a7e
to
0496cb9
Compare
Additionally, I have also reflect the feedback from this review. |
0496cb9
to
6a4a5c2
Compare
6a4a5c2
to
a08c8d7
Compare
I would say that if this is the case we need to fix this in Reactor Netty. Please provide a reproducible scenario! Here this call back was added IIRC in order to handle the scenario when the
|
@violetagg Upon closer inspection, the disposal process follows the flow outlined below when
However, in
Therefore, if As a result, it seems that Do you agree that |
We invoke |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raccoonback Actually ignore my previous comment! You are right, for the client we will keep the buffered data as there are scenarios when data consumption might be delayed!
@violetagg Thanks for your review! 😃 |
@spencergibb |
@spencergibb |
Hello.
I use spring-gateway, reactor-netty to operate the service.
While investing
"LEAK: ByteBuf.release() was not called before it's garbage-collected"
, I would like to ask for suggestions on fixingNettyWriteResponseFilter
.NettyWriteResponseFilter
disposes only when the connection channel is active.However, it seems that
FluxReceive
may result in unreleased memory references. (ChannelOperations)Therefore, I suggest modifying the configuration to always dispose of the connection regardless of the channel status.
(I understand that there is no redundant processing for dispose already inside the connection.)
For example, suppose that an incoming HTTP request was canceled while routing and responding.
Even though the
NioSocketChannel
channel is not active, a memory reference may remain inreceiverQueue
maintained inFluxReceive
.Actually, if delay 5 seconds with a custom GlobalFilter and generate a large number of HTTP cancels after 2 seconds of the total request time, "LEAK: ByteBuf.release() was not called before it's garbage-collected" occurred.
@violetagg
hello.
What do you think about this?