-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Migrate to Netty 4.1 #4397
Conversation
@joschi I am getting tons of these messages. I am running with a beats, netflow and GELF TCP input.
|
@joschi I am also seeing leak detector messages. I am running with "paranoid".
|
@joschi Using the following revisions I am still getting the errors below.
For NetFlow I am using pmacct with the following configuration and another instance with NetFlow version
|
|
@joschi Ah right, I rebased against master before the build. Fixed the value in my previous comment. |
@bernd Could you please record some pcaps of your pmacct traffic which I could replay to reproduce the problem? |
@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
|
@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. |
@joschi I sent you the NetFlow pcap file privately. |
@joschi The input throughput counter does no work anymore: 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 |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's outdated.
Ceterum censeo JavaScript esse delendam.
There was a problem hiding this 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! 👍
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
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
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)
…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)
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
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
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
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
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
Migrate Graylog from Netty 3.10.x to Netty 4.1.x.
Refs #4226