Skip to content

Commit

Permalink
Bump grpc & netty version
Browse files Browse the repository at this point in the history
### What changes are proposed in this pull request?

Bump grpc & netty version

### Why are the changes needed?

1. We want to try netty io_uring feature 
2. The new aws client we are going to introduce relies on newer version of netty 
3. Current grpc & netty versions do not match. (https://github.com/grpc/grpc-java/blob/master/SECURITY.md)

### Does this PR introduce any user facing changes?

N/A
			pr-link: #17413
			change-id: cid-8bfb171d1660c6da96977129b62b6b6640625f4c
  • Loading branch information
elega authored May 11, 2023
1 parent 1e4a885 commit 16cbf9c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
8 changes: 7 additions & 1 deletion dora/core/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>2.0.26.Final</version>
<version>2.0.56.Final</version>
</dependency>

<!-- Internal dependencies -->
Expand Down Expand Up @@ -155,6 +155,12 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class GrpcSerializationUtils {
private static final String BUFFER_INPUT_STREAM_CLASS_NAME =
"io.grpc.internal.ReadableBuffers$BufferInputStream";
private static final String BUFFER_FIELD_NAME = "buffer";
private static final String BUFFERS_FIELD_NAME = "buffers";
private static final String READABLE_BUFFERS_FIELD_NAME = "readableBuffers";
private static final String NETTY_WRITABLE_BUFFER_CLASS_NAME =
"io.grpc.netty.NettyWritableBuffer";
private static final String NETTY_READABLE_BUFFER_CLASS_NAME =
Expand Down Expand Up @@ -79,7 +79,7 @@ public class GrpcSerializationUtils {
sBufferList = getPrivateField(BUFFER_CHAIN_OUTPUT_STREAM_CLASS_NAME, BUFFER_LIST_FIELD_NAME);
sCurrent = getPrivateField(BUFFER_CHAIN_OUTPUT_STREAM_CLASS_NAME, CURRENT_FIELD_NAME);
sCompositeBuffers =
getPrivateField(CompositeReadableBuffer.class.getName(), BUFFERS_FIELD_NAME);
getPrivateField(CompositeReadableBuffer.class.getName(), READABLE_BUFFERS_FIELD_NAME);
sReadableByteBuf = getPrivateField(NETTY_READABLE_BUFFER_CLASS_NAME, BUFFER_FIELD_NAME);
} catch (Exception e) {
LOG.warn("Cannot get gRPC output stream buffer, zero copy receive will be disabled.", e);
Expand All @@ -95,7 +95,7 @@ private static Field getPrivateField(String className, String fieldName)
return field;
}

private static Constructor<?> getPrivateConstructor(String className, Class<?> ...parameterTypes)
private static Constructor<?> getPrivateConstructor(String className, Class<?> ... parameterTypes)
throws ClassNotFoundException, NoSuchMethodException {
Class<?> declaringClass = Class.forName(className);
Constructor<?> constructor = declaringClass.getDeclaredConstructor(parameterTypes);
Expand Down Expand Up @@ -146,6 +146,10 @@ public static ByteBuf getByteBufFromReadableBuffer(ReadableBuffer buffer) {
}
try {
if (buffer instanceof CompositeReadableBuffer) {
// TODO(elega) grpc introduced native protobuf zero copy since 1.39.0
// https://github.com/grpc/grpc-java/pull/8102/files
// replace the following with
// return Unpooled.wrappedBuffer(buffer.getByteBuffer());
Queue<ReadableBuffer> buffers = (Queue<ReadableBuffer>) sCompositeBuffers.get(buffer);
if (buffers.size() == 1) {
return getByteBufFromReadableBuffer(buffers.peek());
Expand Down
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@
<build.path>build</build.path>
<catalyst.version>1.2.1</catalyst.version>
<glusterfs-hadoop.version>2.3.13</glusterfs-hadoop.version>
<grpc.version>1.37.0</grpc.version>
<grpc.version>1.54.1</grpc.version>
<gson.version>2.8.9</gson.version>
<netty.version>4.1.52.Final</netty.version>
<netty.version>4.1.87.Final</netty.version>
<rocksdb.version>7.0.3</rocksdb.version>
<hadoop.version>3.3.1</hadoop.version>
<jacoco.version>0.8.5</jacoco.version>
Expand All @@ -139,6 +139,7 @@
<jersey.version>2.34</jersey.version>
<jetty.version>9.4.46.v20220331</jetty.version>
<junit.version>4.13.1</junit.version>
<jupiter.version>5.9.2</jupiter.version>
<log4j.version>2.17.1</log4j.version>
<maven.version>3.8.6</maven.version>
<metrics.version>4.1.11</metrics.version>
Expand Down

0 comments on commit 16cbf9c

Please sign in to comment.