Suggests to dispose connection when cancelled In NettyWriteResponseFilter #3611
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?