Skip to content

Bump Netty to 4.2.2 #6205

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bom-internal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<artifactId>netty-codec-base</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

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

Did Netty deprecate netty-codec?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The netty-codec module has been split into a number of different sub-modules, which the netty-codec module then depends on. In other words, netty-codec is now multiple jar files instead of one.

<version>${netty.version}</version>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion bundle-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<artifactId>netty-codec-base</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
Expand Down
2 changes: 1 addition & 1 deletion http-clients/netty-nio-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<artifactId>netty-codec-base</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import io.netty.channel.Channel;
import io.netty.channel.ChannelFactory;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.MultiThreadIoEventLoopGroup;
import io.netty.channel.nio.NioIoHandler;
import io.netty.channel.socket.DatagramChannel;
import io.netty.channel.socket.nio.NioDatagramChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
Expand Down Expand Up @@ -142,7 +143,7 @@ private EventLoopGroup resolveEventLoopGroup(DefaultBuilder builder) {
.orElseGet(() -> new ThreadFactoryBuilder()
.threadNamePrefix("aws-java-sdk-NettyEventLoop")
.build());
return new NioEventLoopGroup(numThreads, threadFactory);
return new MultiThreadIoEventLoopGroup(numThreads, threadFactory, NioIoHandler.newFactory());
/*
Need to investigate why epoll is raising channel inactive after successful response that causes
problems with retries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.netty.channel.Channel;
import io.netty.channel.ChannelFactory;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.MultiThreadIoEventLoopGroup;
import io.netty.channel.ReflectiveChannelFactory;
import io.netty.channel.epoll.EpollDatagramChannel;
import io.netty.channel.epoll.EpollEventLoopGroup;
Expand Down Expand Up @@ -67,7 +68,7 @@ public static ChannelFactory<? extends Channel> resolveSocketChannelFactory(Even
return resolveSocketChannelFactory(((DelegatingEventLoopGroup) eventLoopGroup).getDelegate());
}

if (eventLoopGroup instanceof NioEventLoopGroup) {
if (isNioGroup(eventLoopGroup)) {
return NioSocketChannel::new;
}
if (eventLoopGroup instanceof EpollEventLoopGroup) {
Expand Down Expand Up @@ -95,7 +96,7 @@ public static ChannelFactory<? extends DatagramChannel> resolveDatagramChannelFa
return resolveDatagramChannelFactory(((DelegatingEventLoopGroup) eventLoopGroup).getDelegate());
}

if (eventLoopGroup instanceof NioEventLoopGroup) {
if (isNioGroup(eventLoopGroup)) {
return NioDatagramChannel::new;
}
if (eventLoopGroup instanceof EpollEventLoopGroup) {
Expand All @@ -109,4 +110,10 @@ public static ChannelFactory<? extends DatagramChannel> resolveDatagramChannelFa

return invokeSafely(() -> new ReflectiveChannelFactory(Class.forName(datagramFqcn)));
}

private static boolean isNioGroup(EventLoopGroup group) {
return group instanceof NioEventLoopGroup ||
group instanceof MultiThreadIoEventLoopGroup;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ public static SslHandler newSslHandler(SslContext sslContext, ByteBufAllocator a
*/
private static void configureSslEngine(SSLEngine sslEngine) {
SSLParameters sslParameters = sslEngine.getSSLParameters();
sslParameters.setEndpointIdentificationAlgorithm("HTTPS");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sslEngine.setSSLParameters(sslParameters);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.MultiThreadIoEventLoopGroup;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.nio.NioIoHandler;
import io.netty.channel.socket.ServerSocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.codec.http.DefaultHttpContent;
Expand Down Expand Up @@ -312,7 +314,7 @@ public RequestParams build(){
}

private static class Server extends ChannelInitializer<Channel> {
private final NioEventLoopGroup group = new NioEventLoopGroup();
private final EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
private CloseTime closeTime;
private ServerBootstrap bootstrap;
private ServerSocketChannel serverSock;
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
<equalsverifier.version>3.15.1</equalsverifier.version>
<!-- Update netty-open-ssl-version accordingly whenever we update netty version-->
<!-- https://github.com/netty/netty/blob/4.1/pom.xml search "tcnative.version" -->
<netty.version>4.1.118.Final</netty.version>
<netty.version>4.2.2.Final</netty.version>
<unitils.version>3.4.6</unitils.version>
<xmlunit.version>1.3</xmlunit.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -139,7 +139,7 @@
<jimfs.version>1.1</jimfs.version>
<testng.version>7.1.0</testng.version> <!-- TCK Tests -->
<commons-lang.verson>2.6</commons-lang.verson>
<netty-open-ssl-version>2.0.70.Final</netty-open-ssl-version>
<netty-open-ssl-version>2.0.72.Final</netty-open-ssl-version>
<dynamodb-local.version>1.25.0</dynamodb-local.version>
<sqllite.version>1.0.392</sqllite.version>
<blockhound.version>1.0.8.RELEASE</blockhound.version>
Expand Down
4 changes: 2 additions & 2 deletions test/http-client-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.70</version>
<artifactId>bcpkix-jdk18on</artifactId>
<version>1.80</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions test/protocol-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.70</version>
<artifactId>bcpkix-jdk18on</artifactId>
<version>1.80</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Loading