Skip to content

Commit 627108d

Browse files
kraviimanishsinghmowall
authored andcommitted
ODP-1103|netty4 upgrade to 4.1.94
1 parent 509824a commit 627108d

File tree

4 files changed

+85
-6
lines changed

4 files changed

+85
-6
lines changed

hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/RpcProgram.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import io.netty.channel.ChannelHandlerContext;
2828
import io.netty.channel.ChannelInboundHandlerAdapter;
2929
import org.apache.hadoop.thirdparty.com.google.common.annotations.VisibleForTesting;
30+
import io.netty.util.ReferenceCountUtil;
3031
import org.apache.hadoop.oncrpc.RpcAcceptedReply.AcceptState;
3132
import org.apache.hadoop.oncrpc.security.Verifier;
3233
import org.apache.hadoop.oncrpc.security.VerifierNone;
@@ -164,6 +165,15 @@ public void stopDaemons() {}
164165
public void channelRead(ChannelHandlerContext ctx, Object msg)
165166
throws Exception {
166167
RpcInfo info = (RpcInfo) msg;
168+
try {
169+
channelRead(ctx, info);
170+
} finally {
171+
ReferenceCountUtil.release(info.data());
172+
}
173+
}
174+
175+
private void channelRead(ChannelHandlerContext ctx, RpcInfo info)
176+
throws Exception {
167177
RpcCall call = (RpcCall) info.header();
168178

169179
SocketAddress remoteAddress = info.remoteAddress();
@@ -257,4 +267,4 @@ public int getPort() {
257267
public int getPortmapUdpTimeoutMillis() {
258268
return portmapUdpTimeoutMillis;
259269
}
260-
}
270+
}

hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/RpcUtil.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,16 @@ public void channelRead(ChannelHandlerContext ctx, Object msg)
129129
RpcInfo info = null;
130130
try {
131131
RpcCall callHeader = RpcCall.read(in);
132-
ByteBuf dataBuffer = Unpooled.wrappedBuffer(in.buffer()
133-
.slice());
134-
132+
ByteBuf dataBuffer = buf.slice(b.position(), b.remaining());
135133
info = new RpcInfo(callHeader, dataBuffer, ctx, ctx.channel(),
136134
remoteAddress);
137135
} catch (Exception exc) {
138136
LOG.info("Malformed RPC request from " + remoteAddress);
139137
} finally {
140-
buf.release();
138+
// only release buffer if it is not passed to downstream handler
139+
if (info == null) {
140+
buf.release();
141+
}
141142
}
142143

143144
if (info != null) {

hadoop-hdfs-project/hadoop-hdfs-client/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,18 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
8989
<groupId>io.netty</groupId>
9090
<artifactId>netty-common</artifactId>
9191
</exclusion>
92+
<exclusion>
93+
<groupId>io.netty</groupId>
94+
<artifactId>netty-codec-socks</artifactId>
95+
</exclusion>
9296
<exclusion>
9397
<groupId>io.netty</groupId>
9498
<artifactId>netty-handler</artifactId>
9599
</exclusion>
100+
<exclusion>
101+
<groupId>io.netty</groupId>
102+
<artifactId>netty-handler-proxy</artifactId>
103+
</exclusion>
96104
<exclusion>
97105
<groupId>io.netty</groupId>
98106
<artifactId>netty-transport</artifactId>

hadoop-project/pom.xml

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
<htrace3.version>3.1.0-incubating</htrace3.version>
140140
<htrace4.version>4.1.0-incubating</htrace4.version>
141141
<metrics.version>3.2.4</metrics.version>
142-
<netty4.version>4.1.68.Final</netty4.version>
142+
<netty4.version>4.1.94.Final</netty4.version>
143143
<snappy-java.version>1.1.10.4</snappy-java.version>
144144

145145
<!-- Maven protoc compiler -->
@@ -935,6 +935,66 @@
935935
<version>${netty4.version}</version>
936936
</dependency>
937937

938+
<dependency>
939+
<groupId>io.netty</groupId>
940+
<artifactId>netty-codec-socks</artifactId>
941+
<version>${netty4.version}</version>
942+
</dependency>
943+
944+
<dependency>
945+
<groupId>io.netty</groupId>
946+
<artifactId>netty-handler-proxy</artifactId>
947+
<version>${netty4.version}</version>
948+
</dependency>
949+
950+
<dependency>
951+
<groupId>io.netty</groupId>
952+
<artifactId>netty-resolver</artifactId>
953+
<version>${netty4.version}</version>
954+
</dependency>
955+
956+
<dependency>
957+
<groupId>io.netty</groupId>
958+
<artifactId>netty-handler</artifactId>
959+
<version>${netty4.version}</version>
960+
</dependency>
961+
962+
<dependency>
963+
<groupId>io.netty</groupId>
964+
<artifactId>netty-buffer</artifactId>
965+
<version>${netty4.version}</version>
966+
</dependency>
967+
968+
<dependency>
969+
<groupId>io.netty</groupId>
970+
<artifactId>netty-transport</artifactId>
971+
<version>${netty4.version}</version>
972+
</dependency>
973+
974+
<dependency>
975+
<groupId>io.netty</groupId>
976+
<artifactId>netty-common</artifactId>
977+
<version>${netty4.version}</version>
978+
</dependency>
979+
980+
<dependency>
981+
<groupId>io.netty</groupId>
982+
<artifactId>netty-transport-native-unix-common</artifactId>
983+
<version>${netty4.version}</version>
984+
</dependency>
985+
986+
<dependency>
987+
<groupId>io.netty</groupId>
988+
<artifactId>netty-transport-native-epoll</artifactId>
989+
<version>${netty4.version}</version>
990+
</dependency>
991+
992+
<dependency>
993+
<groupId>io.netty</groupId>
994+
<artifactId>netty-codec</artifactId>
995+
<version>${netty4.version}</version>
996+
</dependency>
997+
938998
<dependency>
939999
<groupId>commons-io</groupId>
9401000
<artifactId>commons-io</artifactId>

0 commit comments

Comments
 (0)