Skip to content

Commit

Permalink
ODP-1103|netty4 upgrade to 4.1.94
Browse files Browse the repository at this point in the history
  • Loading branch information
kravii authored and manishsinghmowall committed Mar 21, 2024
1 parent 509824a commit 627108d
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import org.apache.hadoop.thirdparty.com.google.common.annotations.VisibleForTesting;
import io.netty.util.ReferenceCountUtil;
import org.apache.hadoop.oncrpc.RpcAcceptedReply.AcceptState;
import org.apache.hadoop.oncrpc.security.Verifier;
import org.apache.hadoop.oncrpc.security.VerifierNone;
Expand Down Expand Up @@ -164,6 +165,15 @@ public void stopDaemons() {}
public void channelRead(ChannelHandlerContext ctx, Object msg)
throws Exception {
RpcInfo info = (RpcInfo) msg;
try {
channelRead(ctx, info);
} finally {
ReferenceCountUtil.release(info.data());
}
}

private void channelRead(ChannelHandlerContext ctx, RpcInfo info)
throws Exception {
RpcCall call = (RpcCall) info.header();

SocketAddress remoteAddress = info.remoteAddress();
Expand Down Expand Up @@ -257,4 +267,4 @@ public int getPort() {
public int getPortmapUdpTimeoutMillis() {
return portmapUdpTimeoutMillis;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,16 @@ public void channelRead(ChannelHandlerContext ctx, Object msg)
RpcInfo info = null;
try {
RpcCall callHeader = RpcCall.read(in);
ByteBuf dataBuffer = Unpooled.wrappedBuffer(in.buffer()
.slice());

ByteBuf dataBuffer = buf.slice(b.position(), b.remaining());
info = new RpcInfo(callHeader, dataBuffer, ctx, ctx.channel(),
remoteAddress);
} catch (Exception exc) {
LOG.info("Malformed RPC request from " + remoteAddress);
} finally {
buf.release();
// only release buffer if it is not passed to downstream handler
if (info == null) {
buf.release();
}
}

if (info != null) {
Expand Down
8 changes: 8 additions & 0 deletions hadoop-hdfs-project/hadoop-hdfs-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,18 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-codec-socks</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-handler-proxy</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
Expand Down
62 changes: 61 additions & 1 deletion hadoop-project/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<htrace3.version>3.1.0-incubating</htrace3.version>
<htrace4.version>4.1.0-incubating</htrace4.version>
<metrics.version>3.2.4</metrics.version>
<netty4.version>4.1.68.Final</netty4.version>
<netty4.version>4.1.94.Final</netty4.version>
<snappy-java.version>1.1.10.4</snappy-java.version>

<!-- Maven protoc compiler -->
Expand Down Expand Up @@ -935,6 +935,66 @@
<version>${netty4.version}</version>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-socks</artifactId>
<version>${netty4.version}</version>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler-proxy</artifactId>
<version>${netty4.version}</version>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver</artifactId>
<version>${netty4.version}</version>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>${netty4.version}</version>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>${netty4.version}</version>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>${netty4.version}</version>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
<version>${netty4.version}</version>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-unix-common</artifactId>
<version>${netty4.version}</version>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>${netty4.version}</version>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<version>${netty4.version}</version>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down

0 comments on commit 627108d

Please sign in to comment.