[BGPCEP-973] Netty reports ByteBuf leak around mvpn tests Created: 20/Jul/21  Updated: 21/Jul/21  Resolved: 21/Jul/21

Status: Resolved
Project: bgpcep
Component/s: BGP
Affects Version/s: Silicon, Aluminium SR4, 0.16.0
Fix Version/s: Silicon SR2, 0.16.2

Type: Bug Priority: Highest
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

This is present in https://logs.opendaylight.org/releng/vex-yul-odl-jenkins-1/bgpcep-csit-1node-userfeatures-all-phosphorus/89/odl_1/odl1_karaf.log.gz :

2021-07-06T02:27:15,970 | INFO  | pipe-log:log "ROBOT MESSAGE: Starting test bgpcep-userfeatures.txt.060 Bgp Functional Mvpn.Play_To_Odl_intra_ipv6" | core                             | 121 - org.apache.karaf.log.core - 4.3.0 | ROBOT MESSAGE: Starting test bgpcep-userfeatures.txt.060 Bgp Functional Mvpn.Play_To_Odl_intra_ipv6
2021-07-06T02:27:16,988 | ERROR | epollEventLoopGroup-7-7 | ResourceLeakDetector             | 61 - io.netty.common - 4.1.59.Final | LEAK: ByteBuf.release() was not called before it's garbage-collected. See https://netty.io/wiki/reference-counted-objects.html for more information.
Recent access records: 
Created at:
	io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java:385)
	io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:187)
	io.netty.buffer.AbstractByteBufAllocator.buffer(AbstractByteBufAllocator.java:123)
	io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:873)
	org.opendaylight.protocol.bgp.mvpn.impl.attributes.tunnel.identifier.MldpP2mpLspParser.parse(MldpP2mpLspParser.java:95)
	org.opendaylight.protocol.bgp.mvpn.impl.attributes.tunnel.identifier.MldpP2mpLspParser.parse(MldpP2mpLspParser.java:32)
	org.opendaylight.protocol.bgp.mvpn.spi.pojo.attributes.tunnel.identifier.SimpleTunnelIdentifierRegistry.parse(SimpleTunnelIdentifierRegistry.java:40)
	org.opendaylight.protocol.bgp.mvpn.impl.attributes.PMSITunnelAttributeHandler.parseAttribute(PMSITunnelAttributeHandler.java:71)
	org.opendaylight.protocol.bgp.parser.spi.AttributeParser.parseAttribute(AttributeParser.java:55)
	org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleAttributeRegistry.parseAttributes(SimpleAttributeRegistry.java:171)
	org.opendaylight.protocol.bgp.parser.impl.message.BGPUpdateMessageParser.parseAttributes(BGPUpdateMessageParser.java:203)
	org.opendaylight.protocol.bgp.parser.impl.message.BGPUpdateMessageParser.parseMessageBody(BGPUpdateMessageParser.java:156)
	org.opendaylight.protocol.bgp.parser.impl.message.BGPUpdateMessageParser.parseMessageBody(BGPUpdateMessageParser.java:66)
	org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleMessageRegistry.parseBody(SimpleMessageRegistry.java:32)
	org.opendaylight.protocol.bgp.parser.spi.AbstractMessageRegistry.parseMessage(AbstractMessageRegistry.java:66)
	org.opendaylight.protocol.bgp.rib.impl.BGPByteToMessageDecoder.decode(BGPByteToMessageDecoder.java:47)
	io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:508)
	io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:447)
	io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
	io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
	io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
	io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
	io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:795)
	io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:480)
	io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)
	io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	java.base/java.lang.Thread.run(Thread.java:829)

investigate what is going on and plug the leak.



 Comments   
Comment by Robert Varga [ 20/Jul/21 ]

Auditing bgpcep for callers of ByteBuf.readBytes(int) finds a lot of other offenders, we'll use this issue to address all of them.

Generated at Wed Feb 07 19:14:38 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.