Fix bytebuf memory leak when a request is canceled#62
Conversation
|
|
||
| if (ProxyUtils.isChunked(httpRequest)) { | ||
| process(ctx, httpRequest); | ||
| process(ctx, httpRequest, true); |
There was a problem hiding this comment.
we need it so the message is not released when we use chunks (when we do not use custom executor)
| ReferenceCountUtil.retain(httpRequest); | ||
|
|
||
| proxyServer.getMessageProcessingExecutor() | ||
| .execute(wrapTask(() -> { |
There was a problem hiding this comment.
we need to move wrapTask into try block so we release the message in case an exception happens there
| } | ||
| final HttpResponse shortCircuitResponse = currentFilters.clientToProxyRequest(httpRequest); | ||
|
|
||
| if (!authenticationRequired) { |
There was a problem hiding this comment.
refactored authenticationRequired part, there was one extra if statement
|
good job |
|
Hi @viacheslav-fomin-main and @osklyarenko Now we are evaluating VGS's littleproxy version and we are still seeing leaks. I have fixed one leak but there seems to be another place. I didn't understand the GlobalStateHandler role here. |
Fixes: https://app.clubhouse.io/vgs/story/12753/refactor-littleproxy
Another memory leak in lp. This time a message is not released when a request is canceled before the message was processed and sent further to
SetupUpstreamhandler