Skip to content

Commit 2f6525f

Browse files
committed
Bump Netty to 4.2.2
1 parent 00d1c90 commit 2f6525f

File tree

10 files changed

+25
-16
lines changed

10 files changed

+25
-16
lines changed

bom-internal/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
</dependency>
117117
<dependency>
118118
<groupId>io.netty</groupId>
119-
<artifactId>netty-codec</artifactId>
119+
<artifactId>netty-codec-base</artifactId>
120120
<version>${netty.version}</version>
121121
</dependency>
122122
<dependency>

bundle-sdk/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
</exclusion>
109109
<exclusion>
110110
<groupId>io.netty</groupId>
111-
<artifactId>netty-codec</artifactId>
111+
<artifactId>netty-codec-base</artifactId>
112112
</exclusion>
113113
<exclusion>
114114
<groupId>io.netty</groupId>

http-clients/netty-nio-client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
</dependency>
6464
<dependency>
6565
<groupId>io.netty</groupId>
66-
<artifactId>netty-codec</artifactId>
66+
<artifactId>netty-codec-base</artifactId>
6767
</dependency>
6868
<dependency>
6969
<groupId>io.netty</groupId>

http-clients/netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/SdkEventLoopGroup.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
import io.netty.channel.Channel;
1919
import io.netty.channel.ChannelFactory;
2020
import io.netty.channel.EventLoopGroup;
21-
import io.netty.channel.nio.NioEventLoopGroup;
21+
import io.netty.channel.MultiThreadIoEventLoopGroup;
22+
import io.netty.channel.nio.NioIoHandler;
2223
import io.netty.channel.socket.DatagramChannel;
2324
import io.netty.channel.socket.nio.NioDatagramChannel;
2425
import io.netty.channel.socket.nio.NioSocketChannel;
@@ -142,7 +143,7 @@ private EventLoopGroup resolveEventLoopGroup(DefaultBuilder builder) {
142143
.orElseGet(() -> new ThreadFactoryBuilder()
143144
.threadNamePrefix("aws-java-sdk-NettyEventLoop")
144145
.build());
145-
return new NioEventLoopGroup(numThreads, threadFactory);
146+
return new MultiThreadIoEventLoopGroup(numThreads, threadFactory, NioIoHandler.newFactory());
146147
/*
147148
Need to investigate why epoll is raising channel inactive after successful response that causes
148149
problems with retries.

http-clients/netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/internal/utils/ChannelResolver.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import io.netty.channel.Channel;
2121
import io.netty.channel.ChannelFactory;
2222
import io.netty.channel.EventLoopGroup;
23+
import io.netty.channel.MultiThreadIoEventLoopGroup;
2324
import io.netty.channel.ReflectiveChannelFactory;
2425
import io.netty.channel.epoll.EpollDatagramChannel;
2526
import io.netty.channel.epoll.EpollEventLoopGroup;
@@ -67,7 +68,7 @@ public static ChannelFactory<? extends Channel> resolveSocketChannelFactory(Even
6768
return resolveSocketChannelFactory(((DelegatingEventLoopGroup) eventLoopGroup).getDelegate());
6869
}
6970

70-
if (eventLoopGroup instanceof NioEventLoopGroup) {
71+
if (isNioGroup(eventLoopGroup)) {
7172
return NioSocketChannel::new;
7273
}
7374
if (eventLoopGroup instanceof EpollEventLoopGroup) {
@@ -95,7 +96,7 @@ public static ChannelFactory<? extends DatagramChannel> resolveDatagramChannelFa
9596
return resolveDatagramChannelFactory(((DelegatingEventLoopGroup) eventLoopGroup).getDelegate());
9697
}
9798

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

110111
return invokeSafely(() -> new ReflectiveChannelFactory(Class.forName(datagramFqcn)));
111112
}
113+
114+
private static boolean isNioGroup(EventLoopGroup group) {
115+
return group instanceof NioEventLoopGroup ||
116+
group instanceof MultiThreadIoEventLoopGroup;
117+
}
118+
112119
}

http-clients/netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/internal/utils/NettyUtils.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ public static SslHandler newSslHandler(SslContext sslContext, ByteBufAllocator a
336336
*/
337337
private static void configureSslEngine(SSLEngine sslEngine) {
338338
SSLParameters sslParameters = sslEngine.getSSLParameters();
339-
sslParameters.setEndpointIdentificationAlgorithm("HTTPS");
340339
sslEngine.setSSLParameters(sslParameters);
341340
}
342341

http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/ServerConnectivityErrorMessageTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929
import io.netty.channel.ChannelHandlerContext;
3030
import io.netty.channel.ChannelInitializer;
3131
import io.netty.channel.ChannelPipeline;
32+
import io.netty.channel.EventLoopGroup;
33+
import io.netty.channel.MultiThreadIoEventLoopGroup;
3234
import io.netty.channel.SimpleChannelInboundHandler;
33-
import io.netty.channel.nio.NioEventLoopGroup;
35+
import io.netty.channel.nio.NioIoHandler;
3436
import io.netty.channel.socket.ServerSocketChannel;
3537
import io.netty.channel.socket.nio.NioServerSocketChannel;
3638
import io.netty.handler.codec.http.DefaultHttpContent;
@@ -312,7 +314,7 @@ public RequestParams build(){
312314
}
313315

314316
private static class Server extends ChannelInitializer<Channel> {
315-
private final NioEventLoopGroup group = new NioEventLoopGroup();
317+
private final EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
316318
private CloseTime closeTime;
317319
private ServerBootstrap bootstrap;
318320
private ServerSocketChannel serverSock;

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
<equalsverifier.version>3.15.1</equalsverifier.version>
116116
<!-- Update netty-open-ssl-version accordingly whenever we update netty version-->
117117
<!-- https://github.com/netty/netty/blob/4.1/pom.xml search "tcnative.version" -->
118-
<netty.version>4.1.118.Final</netty.version>
118+
<netty.version>4.2.2.Final</netty.version>
119119
<unitils.version>3.4.6</unitils.version>
120120
<xmlunit.version>1.3</xmlunit.version>
121121
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -139,7 +139,7 @@
139139
<jimfs.version>1.1</jimfs.version>
140140
<testng.version>7.1.0</testng.version> <!-- TCK Tests -->
141141
<commons-lang.verson>2.6</commons-lang.verson>
142-
<netty-open-ssl-version>2.0.70.Final</netty-open-ssl-version>
142+
<netty-open-ssl-version>2.0.72.Final</netty-open-ssl-version>
143143
<dynamodb-local.version>1.25.0</dynamodb-local.version>
144144
<sqllite.version>1.0.392</sqllite.version>
145145
<blockhound.version>1.0.8.RELEASE</blockhound.version>

test/http-client-tests/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@
120120
</dependency>
121121
<dependency>
122122
<groupId>org.bouncycastle</groupId>
123-
<artifactId>bcpkix-jdk15on</artifactId>
124-
<version>1.70</version>
123+
<artifactId>bcpkix-jdk18on</artifactId>
124+
<version>1.80</version>
125125
<scope>compile</scope>
126126
</dependency>
127127
<dependency>

test/protocol-tests/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@
292292
</dependency>
293293
<dependency>
294294
<groupId>org.bouncycastle</groupId>
295-
<artifactId>bcpkix-jdk15on</artifactId>
296-
<version>1.70</version>
295+
<artifactId>bcpkix-jdk18on</artifactId>
296+
<version>1.80</version>
297297
<scope>test</scope>
298298
</dependency>
299299
<dependency>

0 commit comments

Comments
 (0)