Skip to content
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

Migrate to Netty 4.1 #4397

Merged
merged 14 commits into from
Jan 18, 2018
Merged

Migrate to Netty 4.1 #4397

merged 14 commits into from
Jan 18, 2018

Conversation

joschi
Copy link
Contributor

@joschi joschi commented Dec 5, 2017

@bernd
Copy link
Member

bernd commented Dec 6, 2017

@joschi I am getting tons of these messages. I am running with a beats, netflow and GELF TCP input.

2017-12-06 15:57:44,330 WARN : io.netty.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
io.netty.util.IllegalReferenceCountException: refCnt: 0, increment: 1
        at io.netty.buffer.AbstractReferenceCountedByteBuf.release0(AbstractReferenceCountedByteBuf.java:100) ~[graylog.jar:?]
        at io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:84) ~[graylog.jar:?]
        at io.netty.buffer.WrappedByteBuf.release(WrappedByteBuf.java:1029) ~[graylog.jar:?]
        at io.netty.buffer.SimpleLeakAwareByteBuf.release(SimpleLeakAwareByteBuf.java:102) ~[graylog.jar:?]
        at io.netty.buffer.AdvancedLeakAwareByteBuf.release(AdvancedLeakAwareByteBuf.java:941) ~[graylog.jar:?]
        at io.netty.util.ReferenceCountUtil.release(ReferenceCountUtil.java:88) ~[graylog.jar:?]
        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:112) ~[graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [graylog.jar:?]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:297) [graylog.jar:?]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:413) [graylog.jar:?]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935) [graylog.jar:?]
        at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:801) [graylog.jar:?]
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:404) [graylog.jar:?]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:304) [graylog.jar:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [graylog.jar:?]
        at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176) [graylog.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_151]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_151]
        at com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66) [graylog.jar:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]

@bernd
Copy link
Member

bernd commented Dec 6, 2017

@joschi I am also seeing leak detector messages. I am running with "paranoid".

2017-12-06 15:59:23,171 ERROR: io.netty.util.ResourceLeakDetector - LEAK: ByteBuf.release() was not called before it's garbage-collected. See http://netty.io/w
iki/reference-counted-objects.html for more information.
Recent access records: 
#1:
        io.netty.buffer.AdvancedLeakAwareByteBuf.getBytes(AdvancedLeakAwareByteBuf.java:244)
        io.netty.buffer.ByteBufUtil.getBytes(ByteBufUtil.java:773)
        io.netty.buffer.ByteBufUtil.getBytes(ByteBufUtil.java:748)
        io.netty.buffer.ByteBufUtil.getBytes(ByteBufUtil.java:740)
        org.graylog.plugins.netflow.codecs.NetflowV9CodecAggregator.addChunk(NetflowV9CodecAggregator.java:205)
        org.graylog.plugins.netflow.transport.NetFlowUdpTransport$NetflowMessageAggregationHandler.channelRead0(NetFlowUdpTransport.java:107)
        org.graylog.plugins.netflow.transport.NetFlowUdpTransport$NetflowMessageAggregationHandler.channelRead0(NetFlowUdpTransport.java:91)
        io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.handler.traffic.AbstractTrafficShapingHandler.channelRead(AbstractTrafficShapingHandler.java:504)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:108)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935)
        io.netty.channel.epoll.EpollDatagramChannel$EpollDatagramChannelUnsafe.epollInReady(EpollDatagramChannel.java:478)
        io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:404)
        io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:304)
        io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
        com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66)
        java.lang.Thread.run(Thread.java:748)
#2:
        io.netty.buffer.AdvancedLeakAwareByteBuf.getBytes(AdvancedLeakAwareByteBuf.java:244)
        io.netty.buffer.ByteBufUtil.getBytes(ByteBufUtil.java:773)
        io.netty.buffer.ByteBufUtil.getBytes(ByteBufUtil.java:748)
        io.netty.buffer.ByteBufUtil.getBytes(ByteBufUtil.java:740)
        org.graylog.plugins.netflow.codecs.NetflowV9CodecAggregator.addChunk(NetflowV9CodecAggregator.java:205)
        org.graylog.plugins.netflow.transport.NetFlowUdpTransport$NetflowMessageAggregationHandler.channelRead0(NetFlowUdpTransport.java:107)
        org.graylog.plugins.netflow.transport.NetFlowUdpTransport$NetflowMessageAggregationHandler.channelRead0(NetFlowUdpTransport.java:91)
        io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.handler.traffic.AbstractTrafficShapingHandler.channelRead(AbstractTrafficShapingHandler.java:504)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:108)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935)
        io.netty.channel.epoll.EpollDatagramChannel$EpollDatagramChannelUnsafe.epollInReady(EpollDatagramChannel.java:478)
        io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$1.run(AbstractEpollChannel.java:412)
        io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
        io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
        io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:309)
        io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
        com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66)
        java.lang.Thread.run(Thread.java:748)
: 10 leak records were discarded because they were duplicates
: 10 leak records were discarded because the leak record count is targeted to 4. Use system property io.netty.leakDetection.targetRecords to increase the limit
.

@bernd
Copy link
Member

bernd commented Dec 13, 2017

@joschi Using the following revisions I am still getting the errors below.

2017-12-13 10:28:25,381 ERROR: io.netty.util.ResourceLeakDetector - LEAK: ByteBuf.release() was not called before it's garbage-collected. See http://netty.io/w
iki/reference-counted-objects.html for more information.
Recent access records: 
#1:
        io.netty.buffer.AdvancedLeakAwareByteBuf.getBytes(AdvancedLeakAwareByteBuf.java:244)
        io.netty.buffer.ByteBufUtil.getBytes(ByteBufUtil.java:773)
        io.netty.buffer.ByteBufUtil.getBytes(ByteBufUtil.java:748)
        io.netty.buffer.ByteBufUtil.getBytes(ByteBufUtil.java:740)
        org.graylog.plugins.netflow.codecs.NetflowV9CodecAggregator.addChunk(NetflowV9CodecAggregator.java:215)
        org.graylog.plugins.netflow.transport.NetflowMessageAggregationHandler.channelRead0(NetflowMessageAggregationHandler.java:49)
        org.graylog.plugins.netflow.transport.NetflowMessageAggregationHandler.channelRead0(NetflowMessageAggregationHandler.java:31)
        io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.handler.traffic.AbstractTrafficShapingHandler.channelRead(AbstractTrafficShapingHandler.java:504)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:108)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935)
        io.netty.channel.epoll.EpollDatagramChannel$EpollDatagramChannelUnsafe.epollInReady(EpollDatagramChannel.java:478)
        io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$1.run(AbstractEpollChannel.java:386)
        io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
        io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
        io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:309)
        io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
        com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66)
        java.lang.Thread.run(Thread.java:748)
#2:
        io.netty.buffer.AdvancedLeakAwareByteBuf.getLong(AdvancedLeakAwareByteBuf.java:202)
        io.netty.buffer.ByteBufUtil.equals(ByteBufUtil.java:230)
        io.netty.buffer.ByteBufUtil.equals(ByteBufUtil.java:267)
        io.netty.buffer.AbstractByteBuf.equals(AbstractByteBuf.java:1318)
        io.netty.buffer.WrappedByteBuf.equals(WrappedByteBuf.java:975)
        java.util.HashMap.putVal(HashMap.java:635)
        java.util.HashMap.put(HashMap.java:612)
        java.util.HashSet.add(HashSet.java:220)
        org.graylog.plugins.netflow.codecs.NetflowV9CodecAggregator.addChunk(NetflowV9CodecAggregator.java:177)
        org.graylog.plugins.netflow.transport.NetflowMessageAggregationHandler.channelRead0(NetflowMessageAggregationHandler.java:49)
        org.graylog.plugins.netflow.transport.NetflowMessageAggregationHandler.channelRead0(NetflowMessageAggregationHandler.java:31)
        io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.handler.traffic.AbstractTrafficShapingHandler.channelRead(AbstractTrafficShapingHandler.java:504)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:108)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935)
        io.netty.channel.epoll.EpollDatagramChannel$EpollDatagramChannelUnsafe.epollInReady(EpollDatagramChannel.java:478)
        io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$1.run(AbstractEpollChannel.java:386)
        io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
        io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
        io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:309)
        io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
        com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66)                                   [270/1900]
        java.lang.Thread.run(Thread.java:748)
: 48 leak records were discarded because they were duplicates
: 48 leak records were discarded because the leak record count is targeted to 4. Use system property io.netty.leakDetection.targetRecords to increase the limit
.
2017-12-13 10:28:01,835 WARN : io.netty.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It u
sually means the last handler in the pipeline did not handle the exception.
io.netty.util.IllegalReferenceCountException: refCnt: 0, increment: 1
        at io.netty.buffer.AbstractReferenceCountedByteBuf.release0(AbstractReferenceCountedByteBuf.java:100) ~[graylog.jar:?]
        at io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:84) ~[graylog.jar:?]
        at io.netty.buffer.WrappedByteBuf.release(WrappedByteBuf.java:1029) ~[graylog.jar:?]
        at io.netty.buffer.SimpleLeakAwareByteBuf.release(SimpleLeakAwareByteBuf.java:102) ~[graylog.jar:?]
        at io.netty.buffer.AdvancedLeakAwareByteBuf.release(AdvancedLeakAwareByteBuf.java:941) ~[graylog.jar:?]
        at io.netty.util.ReferenceCountUtil.release(ReferenceCountUtil.java:88) ~[graylog.jar:?]
        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:112) ~[graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.handler.traffic.AbstractTrafficShapingHandler.channelRead(AbstractTrafficShapingHandler.java:504) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:108) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935) [graylog.jar:?]
        at io.netty.channel.epoll.EpollDatagramChannel$EpollDatagramChannelUnsafe.epollInReady(EpollDatagramChannel.java:478) [graylog.jar:?]
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:404) [graylog.jar:?]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:304) [graylog.jar:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [graylog.jar:?]
        at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176) [graylog.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_151]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_151]
        at com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66) [graylog.jar:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
2017-12-13 10:29:17,137 WARN : io.netty.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It u
sually means the last handler in the pipeline did not handle the exception.
io.netty.util.IllegalReferenceCountException: refCnt: 0, increment: 1
        at io.netty.buffer.AbstractReferenceCountedByteBuf.release0(AbstractReferenceCountedByteBuf.java:100) ~[graylog.jar:?]
        at io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:84) ~[graylog.jar:?]
        at io.netty.buffer.WrappedByteBuf.release(WrappedByteBuf.java:1029) ~[graylog.jar:?]
        at io.netty.buffer.SimpleLeakAwareByteBuf.release(SimpleLeakAwareByteBuf.java:102) ~[graylog.jar:?]
        at io.netty.buffer.AdvancedLeakAwareByteBuf.release(AdvancedLeakAwareByteBuf.java:941) ~[graylog.jar:?]
        at io.netty.util.ReferenceCountUtil.release(ReferenceCountUtil.java:88) ~[graylog.jar:?]
        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:112) ~[graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [graylog.jar:?]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935) [graylog.jar:?]
        at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) [graylog.jar:?]
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:404) [graylog.jar:?]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:304) [graylog.jar:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [graylog.jar:?]
        at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176) [graylog.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_151]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_151]
        at com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66) [graylog.jar:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
2017-12-13 10:29:17,137 ERROR: org.graylog.plugins.netflow.codecs.NetflowV9CodecAggregator - Unexpected failure while aggregating NetFlowV9 packet, discarding 
packet.
io.netty.util.IllegalReferenceCountException: refCnt: 0, increment: 1
        at io.netty.buffer.AbstractReferenceCountedByteBuf.release0(AbstractReferenceCountedByteBuf.java:100) ~[graylog.jar:?]
        at io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:84) ~[graylog.jar:?]
        at io.netty.buffer.CompositeByteBuf.addComponent0(CompositeByteBuf.java:282) ~[graylog.jar:?]
        at io.netty.buffer.CompositeByteBuf.addComponents0(CompositeByteBuf.java:321) ~[graylog.jar:?]
        at io.netty.buffer.CompositeByteBuf.<init>(CompositeByteBuf.java:87) ~[graylog.jar:?]
        at io.netty.buffer.Unpooled.wrappedBuffer(Unpooled.java:323) ~[graylog.jar:?]
        at io.netty.buffer.Unpooled.wrappedBuffer(Unpooled.java:252) ~[graylog.jar:?]
        at org.graylog.plugins.netflow.codecs.NetflowV9CodecAggregator.addChunk(NetflowV9CodecAggregator.java:88) [graylog-plugin-netflow-3.0.0-SNAPSHOT.jar:?]
        at org.graylog.plugins.netflow.transport.NetflowMessageAggregationHandler.channelRead0(NetflowMessageAggregationHandler.java:49) [graylog-plugin-netflo
w-3.0.0-SNAPSHOT.jar:?]
        at org.graylog.plugins.netflow.transport.NetflowMessageAggregationHandler.channelRead0(NetflowMessageAggregationHandler.java:31) [graylog-plugin-netflo
w-3.0.0-SNAPSHOT.jar:?]
        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.handler.traffic.AbstractTrafficShapingHandler.channelRead(AbstractTrafficShapingHandler.java:504) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:108) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935) [graylog.jar:?]
        at io.netty.channel.epoll.EpollDatagramChannel$EpollDatagramChannelUnsafe.epollInReady(EpollDatagramChannel.java:478) [graylog.jar:?]
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:404) [graylog.jar:?]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:304) [graylog.jar:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [graylog.jar:?]
        at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176) [graylog.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_151]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_151]
        at com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66) [graylog.jar:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]

For NetFlow I am using pmacct with the following configuration and another instance with NetFlow version 9.

daemonize: true
pidfile: /var/run/pmacctd.pid
syslog: daemon
aggregate: src_host,dst_host,src_port,dst_port,proto
interface: eth0

plugins: nfprobe
nfprobe_receiver: 10.1.1.183:2055
nfprobe_version: 5
nfprobe_timeouts: tcp=60:maxlife=3600:udp=60:icmp=60

@joschi
Copy link
Contributor Author

joschi commented Dec 13, 2017

Using the following revisions I am still getting the errors below.

  • 02dce78499801e938c2ebc7792b003af3d9d7033

@bernd

$ git log 02dce78499801e938c2ebc7792b003af3d9d7033
fatal: bad object 02dce78499801e938c2ebc7792b003af3d9d7033

@bernd
Copy link
Member

bernd commented Dec 13, 2017

@joschi Ah right, I rebased against master before the build. Fixed the value in my previous comment.

@joschi
Copy link
Contributor Author

joschi commented Dec 13, 2017

@bernd Could you please record some pcaps of your pmacct traffic which I could replay to reproduce the problem?

@bernd
Copy link
Member

bernd commented Dec 13, 2017

@joschi While working on a netflow packet capture, I noticed that I am getting the following error on two different setups when sending GELF TCP messages to the server. (using the Java gelfclient and the Ruby gelf-rb lib)

Example code for sending GELF TCP messages: https://gist.github.com/bernd/330f794086afd1338255f0b5b08fed79

2017-12-13 12:15:52,101 WARN : io.netty.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
io.netty.util.IllegalReferenceCountException: refCnt: 0, increment: 1
        at io.netty.buffer.AbstractReferenceCountedByteBuf.release0(AbstractReferenceCountedByteBuf.java:100) ~[graylog.jar:?]
        at io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:84) ~[graylog.jar:?]
        at io.netty.buffer.WrappedByteBuf.release(WrappedByteBuf.java:1029) ~[graylog.jar:?]
        at io.netty.buffer.SimpleLeakAwareByteBuf.release(SimpleLeakAwareByteBuf.java:102) ~[graylog.jar:?]
        at io.netty.buffer.AdvancedLeakAwareByteBuf.release(AdvancedLeakAwareByteBuf.java:941) ~[graylog.jar:?]
        at io.netty.util.ReferenceCountUtil.release(ReferenceCountUtil.java:88) ~[graylog.jar:?]
        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:112) ~[graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [graylog.jar:?]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:297) [graylog.jar:?]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:413) [graylog.jar:?]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [graylog.jar:?]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [graylog.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [graylog.jar:?]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935) [graylog.jar:?]
        at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) [graylog.jar:?]
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:404) [graylog.jar:?]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:304) [graylog.jar:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [graylog.jar:?]
        at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176) [graylog.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_151]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_151]
        at com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66) [graylog.jar:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]

@bernd
Copy link
Member

bernd commented Dec 13, 2017

@joschi Another issue I noticed:

When I am stopping my Beats input the listener is gone but active connections are still alive and sending new data. It looks like active connections aren't closed when stopping an input.

@bernd
Copy link
Member

bernd commented Dec 13, 2017

@joschi I sent you the NetFlow pcap file privately.

@bernd
Copy link
Member

bernd commented Dec 13, 2017

@joschi The input throughput counter does no work anymore:

image

Happens with a beats and raw input.

@@ -64,7 +63,7 @@ protected void configure() {

bind(ServiceManager.class).toProvider(ServiceManagerProvider.class).asEagerSingleton();

bind(HashedWheelTimer.class).toInstance(new HashedWheelTimer());
// TODO: Dedicated scheduled executor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a todo for this PR or a "nice to have"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a nice to have for ThroughputCounter.

LOG.debug("Setting receive buffer size to {} bytes", recvBufferSize);
bootstrap.setOption("receiveBufferSizePredictorFactory", new FixedReceiveBufferSizePredictorFactory(recvBufferSize));
bootstrap.setOption("receiveBufferSize", recvBufferSize);
// TODO: Make number of channels configurable separately
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a todo for this PR or a "nice to have"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's outdated.

Copy link
Member

@bernd bernd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joschi Thanks for the good work! 👍

@bernd bernd merged commit 6762727 into master Jan 18, 2018
@ghost ghost removed the ready-for-review label Jan 18, 2018
@bernd bernd deleted the netty-4 branch January 18, 2018 10:19
@bernd bernd mentioned this pull request Jan 18, 2018
bernd added a commit that referenced this pull request Jan 15, 2019
This fixes an issue that has been introduced with the big Netty 4.1
update in PR #4397.

In Netty 3.x we always passed a "MessageEvent" through the channel
pipeline and got the remote address from that object. Since this object
doesn't exist anymore in Netty 4.x, we only pass the message payload's
"ByteBuf" through the pipeline and rely on the "Channel#getRemoteAddress"
method to always return the remote address object.

The problem is that this does indeed work for TCP based channels but it
doesn't work for UDP based channels. For UDP channels the
"#getRemoteAddress()" method always returns "null".

This is probably due to the connection-less nature of UDP.
For UDP transports Netty only creates a single channel. For TCP transports
there is one channel per TCP connection

To fix this we need to get our hands on the remote address when we
create the "RawMessage" object at the very end of the Netty pipeline.

Since we only pass the message payload "ByteBuf" through the Netty
pipeline, we could previously reuse several classes for TCP and UDP
transports because they were basically the same.

For UDP transports we now need to carry the remote address through the
pipeline by using a "AddressedEnvelope" (available in Netty) that takes
a payload and a sender/receiver object.

That means we have to create a few UDP specific - or rather
"AddressedEnvelope" specific - pipeline handlers because the shared ones
only know how to handle "ByteBuf" messages.

This PR moves some shared code out of the "NettyTransport" class up to
"AbstractTcpTransport" and "UdpTransport" so we can customize the
pipeline for the two different payload types. It also creates new
message aggregation handlers for the "AddressedEnvelope" objects.

In the future we can probably refactor this to share some more code, but
for 3.0 I tried to change as few as possible. The TCP pipeline is
basically unchanged apart from the "AbstractTcpTransport" change.

Fixes #5264
Fixes #5293
kroepke pushed a commit that referenced this pull request Jan 15, 2019
This fixes an issue that has been introduced with the big Netty 4.1
update in PR #4397.

In Netty 3.x we always passed a "MessageEvent" through the channel
pipeline and got the remote address from that object. Since this object
doesn't exist anymore in Netty 4.x, we only pass the message payload's
"ByteBuf" through the pipeline and rely on the "Channel#getRemoteAddress"
method to always return the remote address object.

The problem is that this does indeed work for TCP based channels but it
doesn't work for UDP based channels. For UDP channels the
"#getRemoteAddress()" method always returns "null".

This is probably due to the connection-less nature of UDP.
For UDP transports Netty only creates a single channel. For TCP transports
there is one channel per TCP connection

To fix this we need to get our hands on the remote address when we
create the "RawMessage" object at the very end of the Netty pipeline.

Since we only pass the message payload "ByteBuf" through the Netty
pipeline, we could previously reuse several classes for TCP and UDP
transports because they were basically the same.

For UDP transports we now need to carry the remote address through the
pipeline by using a "AddressedEnvelope" (available in Netty) that takes
a payload and a sender/receiver object.

That means we have to create a few UDP specific - or rather
"AddressedEnvelope" specific - pipeline handlers because the shared ones
only know how to handle "ByteBuf" messages.

This PR moves some shared code out of the "NettyTransport" class up to
"AbstractTcpTransport" and "UdpTransport" so we can customize the
pipeline for the two different payload types. It also creates new
message aggregation handlers for the "AddressedEnvelope" objects.

In the future we can probably refactor this to share some more code, but
for 3.0 I tried to change as few as possible. The TCP pipeline is
basically unchanged apart from the "AbstractTcpTransport" change.

Fixes #5264
Fixes #5293

**Note:** This needs to be cherry-picked into 3.0
bernd added a commit that referenced this pull request Jan 16, 2019
This fixes an issue that has been introduced with the big Netty 4.1
update in PR #4397.

In Netty 3.x we always passed a "MessageEvent" through the channel
pipeline and got the remote address from that object. Since this object
doesn't exist anymore in Netty 4.x, we only pass the message payload's
"ByteBuf" through the pipeline and rely on the "Channel#getRemoteAddress"
method to always return the remote address object.

The problem is that this does indeed work for TCP based channels but it
doesn't work for UDP based channels. For UDP channels the
"#getRemoteAddress()" method always returns "null".

This is probably due to the connection-less nature of UDP.
For UDP transports Netty only creates a single channel. For TCP transports
there is one channel per TCP connection

To fix this we need to get our hands on the remote address when we
create the "RawMessage" object at the very end of the Netty pipeline.

Since we only pass the message payload "ByteBuf" through the Netty
pipeline, we could previously reuse several classes for TCP and UDP
transports because they were basically the same.

For UDP transports we now need to carry the remote address through the
pipeline by using a "AddressedEnvelope" (available in Netty) that takes
a payload and a sender/receiver object.

That means we have to create a few UDP specific - or rather
"AddressedEnvelope" specific - pipeline handlers because the shared ones
only know how to handle "ByteBuf" messages.

This PR moves some shared code out of the "NettyTransport" class up to
"AbstractTcpTransport" and "UdpTransport" so we can customize the
pipeline for the two different payload types. It also creates new
message aggregation handlers for the "AddressedEnvelope" objects.

In the future we can probably refactor this to share some more code, but
for 3.0 I tried to change as few as possible. The TCP pipeline is
basically unchanged apart from the "AbstractTcpTransport" change.

Fixes #5264
Fixes #5293

**Note:** This needs to be cherry-picked into 3.0

(cherry picked from commit 375e618)
kroepke pushed a commit that referenced this pull request Jan 16, 2019
…5519)

This fixes an issue that has been introduced with the big Netty 4.1
update in PR #4397.

In Netty 3.x we always passed a "MessageEvent" through the channel
pipeline and got the remote address from that object. Since this object
doesn't exist anymore in Netty 4.x, we only pass the message payload's
"ByteBuf" through the pipeline and rely on the "Channel#getRemoteAddress"
method to always return the remote address object.

The problem is that this does indeed work for TCP based channels but it
doesn't work for UDP based channels. For UDP channels the
"#getRemoteAddress()" method always returns "null".

This is probably due to the connection-less nature of UDP.
For UDP transports Netty only creates a single channel. For TCP transports
there is one channel per TCP connection

To fix this we need to get our hands on the remote address when we
create the "RawMessage" object at the very end of the Netty pipeline.

Since we only pass the message payload "ByteBuf" through the Netty
pipeline, we could previously reuse several classes for TCP and UDP
transports because they were basically the same.

For UDP transports we now need to carry the remote address through the
pipeline by using a "AddressedEnvelope" (available in Netty) that takes
a payload and a sender/receiver object.

That means we have to create a few UDP specific - or rather
"AddressedEnvelope" specific - pipeline handlers because the shared ones
only know how to handle "ByteBuf" messages.

This PR moves some shared code out of the "NettyTransport" class up to
"AbstractTcpTransport" and "UdpTransport" so we can customize the
pipeline for the two different payload types. It also creates new
message aggregation handlers for the "AddressedEnvelope" objects.

In the future we can probably refactor this to share some more code, but
for 3.0 I tried to change as few as possible. The TCP pipeline is
basically unchanged apart from the "AbstractTcpTransport" change.

Fixes #5264
Fixes #5293

**Note:** This needs to be cherry-picked into 3.0

(cherry picked from commit 375e618)
mpfz0r added a commit that referenced this pull request May 22, 2019
The Input configuration TLS Client Auth Trusted Certs used to support
either a file, or a directory of certificates.
This got broken in 3.0 with PR #4397

- Fix this by extending also handling directories in loadCertificates().
- Delete the old TrustManager based version that is not used anymore.
- Extend the KeyUtilTest and use `Resources.getResource()` instead,
  which does not rely on the resources to exist in the target directory.

Fixes #5939
mpfz0r added a commit that referenced this pull request May 22, 2019
The Input configuration TLS Client Auth Trusted Certs used to support
either a file, or a directory of certificates.
This got broken in 3.0 with PR #4397

- Fix this by extending loadCertificates() to also handle directories.
- Delete the old TrustManager based version that is not used anymore.
- Extend the KeyUtilTest and use `Resources.getResource()` instead,
  which does not rely on the resources to exist in the target directory.

Fixes #5939
kmerz pushed a commit that referenced this pull request Jul 9, 2019
The Input configuration TLS Client Auth Trusted Certs used to support
either a file, or a directory of certificates.
This got broken in 3.0 with PR #4397

- Fix this by extending loadCertificates() to also handle directories.
- Delete the old TrustManager based version that is not used anymore.
- Extend the KeyUtilTest and use `Resources.getResource()` instead,
  which does not rely on the resources to exist in the target directory.

Fixes #5939
kmerz pushed a commit that referenced this pull request Jul 9, 2019
The Input configuration TLS Client Auth Trusted Certs used to support
either a file, or a directory of certificates.
This got broken in 3.0 with PR #4397

- Fix this by extending loadCertificates() to also handle directories.
- Delete the old TrustManager based version that is not used anymore.
- Extend the KeyUtilTest and use `Resources.getResource()` instead,
  which does not rely on the resources to exist in the target directory.

Fixes #5939
mpfz0r pushed a commit that referenced this pull request Jul 9, 2019
The Input configuration TLS Client Auth Trusted Certs used to support
either a file, or a directory of certificates.
This got broken in 3.0 with PR #4397

- Fix this by extending loadCertificates() to also handle directories.
- Delete the old TrustManager based version that is not used anymore.
- Extend the KeyUtilTest and use `Resources.getResource()` instead,
  which does not rely on the resources to exist in the target directory.

Fixes #5939
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants