Fixing memory leaks#48
Conversation
| LOG.warn("Server timed out: {}", currentServerConnection); | ||
| currentFilters.serverToProxyResponseTimedOut(); | ||
| writeGatewayTimeout(currentRequest); | ||
| writeGatewayTimeout(serverConnection.getInitialRequest()); |
There was a problem hiding this comment.
I am not 100% sure I can do it.. testing..
| if (currentRequest instanceof ReferenceCounted) { | ||
| ((ReferenceCounted)currentRequest).release(); | ||
| } | ||
| } |
There was a problem hiding this comment.
I think this copy is here so original request can not be mutated in request filter written by a user (by VGS team for example)
… write of initial request
|
looks good so far |
| if (msg instanceof ReferenceCounted) { | ||
| ((ReferenceCounted)msg).release(); | ||
| } | ||
| throw new RuntimeException("Failed to execute inbound global state handler", e); |
There was a problem hiding this comment.
@viacheslav-fomin-main let's present the error handling types intact for now. i don't want to introduce too many changes.
There was a problem hiding this comment.
@Override
public final void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
throws Exception {
exceptionCaught(cause);
}
it could be simpler to move this logic to
org.littleshoot.proxy.impl.ProxyConnection#exceptionCaught(io.netty.channel.ChannelHandlerContext, java.lang.Throwable)
a024e5d to
7fdd448
Compare
|
i did some performance testing (edited)
|
|
Hi @viacheslav-fomin-main @osklyarenko, Here is the stack trace of what we are seeing when we have Netty leak detection property set to PARANOID. We have the property 13:36:41.577 ERROR [E-PROXY-0-ClientToProxyWorker-4] [ResourceLeakDetector:171] - LEAK: ByteBuf.release() was not called before it's garbage-collected. See http://netty.io/wiki/reference-counted-objects.html for more information. There is more to it. Would really appreciate any guidance on this. This is the PR which I am working on - vmware-archive#2 |
Still being tested. DO NOT MERGE