Skip to content

Upgrade Netty version from 4.1.68 to 4.1.72 #2925

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

Merged
merged 5 commits into from
Jan 7, 2022

Conversation

Bennett-Lynch
Copy link
Contributor

Upgrade Netty version from 4.1.68 to 4.1.72.

  1. https://netty.io/news/2021/10/11/4-1-69-Final.html
  2. https://netty.io/news/2021/10/11/4-1-70-Final.html
  3. https://netty.io/news/2021/12/09/4-1-71-Final.html
  4. https://netty.io/news/2021/12/13/4-1-72-Final.html

License

  • I confirm that this pull request can be released under the Apache 2 license

Bennett Lynch added 2 commits December 15, 2021 08:34
Upgrade Netty version from 4.1.68 to 4.1.72
Upgrade Netty version from 4.1.68 to 4.1.72
@Bennett-Lynch Bennett-Lynch requested a review from a team as a code owner December 15, 2021 16:36
@@ -186,6 +194,7 @@ public boolean awaitTermination(long timeout, TimeUnit unit) {

@Override
public ChannelFuture register(Channel channel) {
((CustomEmbeddedChannel) channel).loop = this;
Copy link
Contributor Author

@Bennett-Lynch Bennett-Lynch Dec 15, 2021

Choose a reason for hiding this comment

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

Needed to support the change in behavior introduced by netty/netty@ef1f637:

java.lang.ClassCastException: software.amazon.awssdk.http.nio.netty.internal.nrs.HandlerSubscriberTest$CustomEmbeddedEventLoop cannot be cast to io.netty.channel.embedded.EmbeddedEventLoop
--
at software.amazon.awssdk.http.nio.netty.internal.nrs.HandlerSubscriberTest.teardown(HandlerSubscriberTest.java:69)
 
[System Output]
2021-12-15 16:41:35,290 [main] WARN  io.netty.channel.embedded.EmbeddedChannel - More than one exception was raised. Will report only the first one and log others.
java.lang.ClassCastException: software.amazon.awssdk.http.nio.netty.internal.nrs.HandlerSubscriberTest$CustomEmbeddedEventLoop cannot be cast to io.netty.channel.embedded.EmbeddedEventLoop
at io.netty.channel.embedded.EmbeddedChannel.embeddedEventLoop(EmbeddedChannel.java:680)
at io.netty.channel.embedded.EmbeddedChannel.runPendingTasks(EmbeddedChannel.java:602)
at io.netty.channel.embedded.EmbeddedChannel$EmbeddedUnsafe$1.beginRead(EmbeddedChannel.java:842)
at io.netty.channel.DefaultChannelPipeline$HeadContext.read(DefaultChannelPipeline.java:1362)
at io.netty.channel.AbstractChannelHandlerContext.invokeRead(AbstractChannelHandlerContext.java:686)
at io.netty.channel.AbstractChannelHandlerContext.read(AbstractChannelHandlerContext.java:671)
at io.netty.channel.DefaultChannelPipeline.read(DefaultChannelPipeline.java:1004)
at io.netty.channel.AbstractChannel.read(AbstractChannel.java:290)
at io.netty.channel.DefaultChannelPipeline$HeadContext.readIfIsAutoRead(DefaultChannelPipeline.java:1422)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelActive(DefaultChannelPipeline.java:1400)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:230)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:216)
at io.netty.channel.DefaultChannelPipeline.fireChannelActive(DefaultChannelPipeline.java:895)
at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:522)
at io.netty.channel.AbstractChannel$AbstractUnsafe.register(AbstractChannel.java:480)
at io.netty.channel.embedded.EmbeddedChannel$EmbeddedUnsafe$1.register(EmbeddedChannel.java:799)
at software.amazon.awssdk.http.nio.netty.internal.nrs.HandlerSubscriberTest$CustomEmbeddedEventLoop.register(HandlerSubscriberTest.java:195)
at software.amazon.awssdk.http.nio.netty.internal.nrs.HandlerSubscriberTest$CustomEmbeddedEventLoop.register(HandlerSubscriberTest.java:189)
at software.amazon.awssdk.http.nio.netty.internal.nrs.HandlerSubscriberTest.setup(HandlerSubscriberTest.java:61)

https://github.com/netty/netty/blob/11ba4cbdd5767b4f0fbb893880d255588d1067e6/transport/src/main/java/io/netty/channel/embedded/EmbeddedChannel.java#L680

@debora-ito debora-ito linked an issue Dec 15, 2021 that may be closed by this pull request
1 task
@@ -141,9 +141,8 @@
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<artifactId>netty-transport-classes-epoll</artifactId>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Motivated by build failure:

[INFO] --- maven-dependency-plugin:3.1.1:analyze-only (default) @ netty-nio-client ---
[WARNING] Used undeclared dependencies found:
[WARNING]    io.netty:netty-transport-classes-epoll:jar:4.1.72.Final:compile
[WARNING] Unused declared dependencies found:
[WARNING]    io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.72.Final:compile

Choose a reason for hiding this comment

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

Is the dependency netty-transport-classes-epoll really useful without one version of netty-transport-native-epoll which contains the native library use by netty-transport-classes-epoll? Or are user expected to add their own dependency on netty-transport-classes-epoll?

@Bennett-Lynch Bennett-Lynch changed the title Upgrade Netty version to 4.1.72 Upgrade Netty version from 4.1.68 to 4.1.72 Dec 15, 2021
@lokanx
Copy link

lokanx commented Dec 21, 2021

Any plans to merge and release this PR soon?

@Bennett-Lynch
Copy link
Contributor Author

Hi @lokanx. I will try to get this PR merged and released soon. It is currently blocked on some additional testing.

If you have an urgent need to upgrade your consumed Netty version before the SDK change is released, you can also explicitly declare the version of Netty that you would like to use, rather than relying on the SDK's transitive dependency. Minor/patch version increases should generally be backwards compatible. An example of doing that with Maven can be found here and with Gradle can be found here.

That said, I understand this may not be a convenient option for all users, and they may still prefer the SDK to pull in the preferred version, so I will continue to prioritize this.

@Bennett-Lynch Bennett-Lynch enabled auto-merge (squash) January 7, 2022 17:50
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Bennett-Lynch Bennett-Lynch merged commit 291b949 into aws:master Jan 7, 2022
@Bennett-Lynch
Copy link
Contributor Author

Bennett-Lynch commented Jan 7, 2022

Released on 2022-01-07 as part of version 2.17.107.

aws-sdk-java-automation pushed a commit that referenced this pull request Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Current Netty version has vulnerability
4 participants