This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 75d7e557d84 [improve][misc] Upgrade to Netty 4.1.111.Final and switch 
to use grpc-netty-shaded (#22892)
75d7e557d84 is described below

commit 75d7e557d84bf2cca2ec791dfe8479b8a6df7875
Author: Lari Hotari <lhot...@users.noreply.github.com>
AuthorDate: Thu Jun 13 01:24:04 2024 +0300

    [improve][misc] Upgrade to Netty 4.1.111.Final and switch to use 
grpc-netty-shaded (#22892)
---
 distribution/server/pom.xml                        |  13 ++
 distribution/server/src/assemble/LICENSE.bin.txt   |  50 +++---
 distribution/shell/src/assemble/LICENSE.bin.txt    |  40 ++---
 jetcd-core-shaded/pom.xml                          | 187 +++++++++++++++++++++
 pom.xml                                            |  60 ++++++-
 pulsar-broker/pom.xml                              |  12 ++
 pulsar-functions/instance/pom.xml                  |   9 +-
 pulsar-metadata/pom.xml                            |  11 +-
 .../pulsar/metadata/impl/EtcdMetadataStore.java    |   6 +-
 9 files changed, 329 insertions(+), 59 deletions(-)

diff --git a/distribution/server/pom.xml b/distribution/server/pom.xml
index adabddfa31d..c42b0a13785 100644
--- a/distribution/server/pom.xml
+++ b/distribution/server/pom.xml
@@ -39,6 +39,19 @@
       <version>${project.version}</version>
     </dependency>
 
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>pulsar-metadata</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>jetcd-core-shaded</artifactId>
+      <version>${project.version}</version>
+      <classifier>shaded</classifier>
+    </dependency>
+
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>pulsar-docs-tools</artifactId>
diff --git a/distribution/server/src/assemble/LICENSE.bin.txt 
b/distribution/server/src/assemble/LICENSE.bin.txt
index 6769df39037..1a66ab6d70a 100644
--- a/distribution/server/src/assemble/LICENSE.bin.txt
+++ b/distribution/server/src/assemble/LICENSE.bin.txt
@@ -292,27 +292,27 @@ The Apache Software License, Version 2.0
     - org.apache.commons-commons-lang3-3.11.jar
     - org.apache.commons-commons-text-1.10.0.jar
  * Netty
-    - io.netty-netty-buffer-4.1.108.Final.jar
-    - io.netty-netty-codec-4.1.108.Final.jar
-    - io.netty-netty-codec-dns-4.1.108.Final.jar
-    - io.netty-netty-codec-http-4.1.108.Final.jar
-    - io.netty-netty-codec-http2-4.1.108.Final.jar
-    - io.netty-netty-codec-socks-4.1.108.Final.jar
-    - io.netty-netty-codec-haproxy-4.1.108.Final.jar
-    - io.netty-netty-common-4.1.108.Final.jar
-    - io.netty-netty-handler-4.1.108.Final.jar
-    - io.netty-netty-handler-proxy-4.1.108.Final.jar
-    - io.netty-netty-resolver-4.1.108.Final.jar
-    - io.netty-netty-resolver-dns-4.1.108.Final.jar
-    - io.netty-netty-resolver-dns-classes-macos-4.1.108.Final.jar
-    - io.netty-netty-resolver-dns-native-macos-4.1.108.Final-osx-aarch_64.jar
-    - io.netty-netty-resolver-dns-native-macos-4.1.108.Final-osx-x86_64.jar
-    - io.netty-netty-transport-4.1.108.Final.jar
-    - io.netty-netty-transport-classes-epoll-4.1.108.Final.jar
-    - io.netty-netty-transport-native-epoll-4.1.108.Final-linux-aarch_64.jar
-    - io.netty-netty-transport-native-epoll-4.1.108.Final-linux-x86_64.jar
-    - io.netty-netty-transport-native-unix-common-4.1.108.Final.jar
-    - 
io.netty-netty-transport-native-unix-common-4.1.108.Final-linux-x86_64.jar
+    - io.netty-netty-buffer-4.1.111.Final.jar
+    - io.netty-netty-codec-4.1.111.Final.jar
+    - io.netty-netty-codec-dns-4.1.111.Final.jar
+    - io.netty-netty-codec-http-4.1.111.Final.jar
+    - io.netty-netty-codec-http2-4.1.111.Final.jar
+    - io.netty-netty-codec-socks-4.1.111.Final.jar
+    - io.netty-netty-codec-haproxy-4.1.111.Final.jar
+    - io.netty-netty-common-4.1.111.Final.jar
+    - io.netty-netty-handler-4.1.111.Final.jar
+    - io.netty-netty-handler-proxy-4.1.111.Final.jar
+    - io.netty-netty-resolver-4.1.111.Final.jar
+    - io.netty-netty-resolver-dns-4.1.111.Final.jar
+    - io.netty-netty-resolver-dns-classes-macos-4.1.111.Final.jar
+    - io.netty-netty-resolver-dns-native-macos-4.1.111.Final-osx-aarch_64.jar
+    - io.netty-netty-resolver-dns-native-macos-4.1.111.Final-osx-x86_64.jar
+    - io.netty-netty-transport-4.1.111.Final.jar
+    - io.netty-netty-transport-classes-epoll-4.1.111.Final.jar
+    - io.netty-netty-transport-native-epoll-4.1.111.Final-linux-aarch_64.jar
+    - io.netty-netty-transport-native-epoll-4.1.111.Final-linux-x86_64.jar
+    - io.netty-netty-transport-native-unix-common-4.1.111.Final.jar
+    - 
io.netty-netty-transport-native-unix-common-4.1.111.Final-linux-x86_64.jar
     - io.netty-netty-tcnative-boringssl-static-2.0.65.Final.jar
     - io.netty-netty-tcnative-boringssl-static-2.0.65.Final-linux-aarch_64.jar
     - io.netty-netty-tcnative-boringssl-static-2.0.65.Final-linux-x86_64.jar
@@ -434,7 +434,6 @@ The Apache Software License, Version 2.0
     - io.grpc-grpc-auth-1.56.0.jar
     - io.grpc-grpc-context-1.56.0.jar
     - io.grpc-grpc-core-1.56.0.jar
-    - io.grpc-grpc-netty-1.56.0.jar
     - io.grpc-grpc-protobuf-1.56.0.jar
     - io.grpc-grpc-protobuf-lite-1.56.0.jar
     - io.grpc-grpc-stub-1.56.0.jar
@@ -498,7 +497,6 @@ The Apache Software License, Version 2.0
     - io.vertx-vertx-core-4.5.8.jar
     - io.vertx-vertx-web-4.5.8.jar
     - io.vertx-vertx-web-common-4.5.8.jar
-    - io.vertx-vertx-grpc-4.5.8.jar
   * Apache ZooKeeper
     - org.apache.zookeeper-zookeeper-3.9.2.jar
     - org.apache.zookeeper-zookeeper-jute-3.9.2.jar
@@ -510,11 +508,7 @@ The Apache Software License, Version 2.0
     - com.google.http-client-google-http-client-1.41.0.jar
     - com.google.auto.value-auto-value-annotations-1.10.1.jar
     - com.google.re2j-re2j-1.7.jar
-  * Jetcd
-    - io.etcd-jetcd-api-0.7.7.jar
-    - io.etcd-jetcd-common-0.7.7.jar
-    - io.etcd-jetcd-core-0.7.7.jar
-    - io.etcd-jetcd-grpc-0.7.7.jar
+  * Jetcd - shaded
   * IPAddress
     - com.github.seancfoley-ipaddress-5.5.0.jar
   * RxJava
diff --git a/distribution/shell/src/assemble/LICENSE.bin.txt 
b/distribution/shell/src/assemble/LICENSE.bin.txt
index 5c3b051cfdd..ff590023ff3 100644
--- a/distribution/shell/src/assemble/LICENSE.bin.txt
+++ b/distribution/shell/src/assemble/LICENSE.bin.txt
@@ -347,23 +347,23 @@ The Apache Software License, Version 2.0
     - commons-text-1.10.0.jar
     - commons-compress-1.26.0.jar
  * Netty
-    - netty-buffer-4.1.108.Final.jar
-    - netty-codec-4.1.108.Final.jar
-    - netty-codec-dns-4.1.108.Final.jar
-    - netty-codec-http-4.1.108.Final.jar
-    - netty-codec-socks-4.1.108.Final.jar
-    - netty-codec-haproxy-4.1.108.Final.jar
-    - netty-common-4.1.108.Final.jar
-    - netty-handler-4.1.108.Final.jar
-    - netty-handler-proxy-4.1.108.Final.jar
-    - netty-resolver-4.1.108.Final.jar
-    - netty-resolver-dns-4.1.108.Final.jar
-    - netty-transport-4.1.108.Final.jar
-    - netty-transport-classes-epoll-4.1.108.Final.jar
-    - netty-transport-native-epoll-4.1.108.Final-linux-aarch_64.jar
-    - netty-transport-native-epoll-4.1.108.Final-linux-x86_64.jar
-    - netty-transport-native-unix-common-4.1.108.Final.jar
-    - netty-transport-native-unix-common-4.1.108.Final-linux-x86_64.jar
+    - netty-buffer-4.1.111.Final.jar
+    - netty-codec-4.1.111.Final.jar
+    - netty-codec-dns-4.1.111.Final.jar
+    - netty-codec-http-4.1.111.Final.jar
+    - netty-codec-socks-4.1.111.Final.jar
+    - netty-codec-haproxy-4.1.111.Final.jar
+    - netty-common-4.1.111.Final.jar
+    - netty-handler-4.1.111.Final.jar
+    - netty-handler-proxy-4.1.111.Final.jar
+    - netty-resolver-4.1.111.Final.jar
+    - netty-resolver-dns-4.1.111.Final.jar
+    - netty-transport-4.1.111.Final.jar
+    - netty-transport-classes-epoll-4.1.111.Final.jar
+    - netty-transport-native-epoll-4.1.111.Final-linux-aarch_64.jar
+    - netty-transport-native-epoll-4.1.111.Final-linux-x86_64.jar
+    - netty-transport-native-unix-common-4.1.111.Final.jar
+    - netty-transport-native-unix-common-4.1.111.Final-linux-x86_64.jar
     - netty-tcnative-boringssl-static-2.0.65.Final.jar
     - netty-tcnative-boringssl-static-2.0.65.Final-linux-aarch_64.jar
     - netty-tcnative-boringssl-static-2.0.65.Final-linux-x86_64.jar
@@ -374,9 +374,9 @@ The Apache Software License, Version 2.0
     - netty-incubator-transport-classes-io_uring-0.0.24.Final.jar
     - netty-incubator-transport-native-io_uring-0.0.24.Final-linux-aarch_64.jar
     - netty-incubator-transport-native-io_uring-0.0.24.Final-linux-x86_64.jar
-    - netty-resolver-dns-classes-macos-4.1.108.Final.jar
-    - netty-resolver-dns-native-macos-4.1.108.Final-osx-aarch_64.jar
-    - netty-resolver-dns-native-macos-4.1.108.Final-osx-x86_64.jar
+    - netty-resolver-dns-classes-macos-4.1.111.Final.jar
+    - netty-resolver-dns-native-macos-4.1.111.Final-osx-aarch_64.jar
+    - netty-resolver-dns-native-macos-4.1.111.Final-osx-x86_64.jar
  * Prometheus client
     - simpleclient-0.16.0.jar
     - simpleclient_log4j2-0.16.0.jar
diff --git a/jetcd-core-shaded/pom.xml b/jetcd-core-shaded/pom.xml
new file mode 100644
index 00000000000..d8819a1148a
--- /dev/null
+++ b/jetcd-core-shaded/pom.xml
@@ -0,0 +1,187 @@
+<?xml version="1.0"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<project
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";
+        xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.pulsar</groupId>
+    <artifactId>pulsar</artifactId>
+    <version>3.4.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>jetcd-core-shaded</artifactId>
+  <name>Apache Pulsar :: jetcd-core shaded</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.etcd</groupId>
+      <artifactId>jetcd-core</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>io.grpc</groupId>
+          <artifactId>grpc-netty</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>io.netty</groupId>
+          <artifactId>*</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>io.grpc</groupId>
+      <artifactId>grpc-netty-shaded</artifactId>
+    </dependency>
+    <!-- add transient dependencies for jetcd libraries, this is necessary for 
IntelliJ support -->
+    <dependency>
+      <groupId>dev.failsafe</groupId>
+      <artifactId>failsafe</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.grpc</groupId>
+      <artifactId>grpc-protobuf</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.grpc</groupId>
+      <artifactId>grpc-stub</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.grpc</groupId>
+      <artifactId>grpc-grpclb</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.grpc</groupId>
+      <artifactId>grpc-util</artifactId>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <createDependencyReducedPom>true</createDependencyReducedPom>
+              
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
+              <minimizeJar>false</minimizeJar>
+              <artifactSet>
+                <includes>
+                  <include>io.etcd:*</include>
+                  <include>io.vertx:*</include>
+                </includes>
+              </artifactSet>
+              <relocations>
+                <!-- relocate vertx packages since they will be transformed to 
use grpc-netty-shaded packages -->
+                <relocation>
+                  <pattern>io.vertx</pattern>
+                  
<shadedPattern>org.apache.pulsar.jetcd.shaded.io.vertx</shadedPattern>
+                </relocation>
+                <!-- relocate to use grpc-netty-shaded packages -->
+                <relocation>
+                  <pattern>io.grpc.netty</pattern>
+                  
<shadedPattern>io.grpc.netty.shaded.io.grpc.netty</shadedPattern>
+                </relocation>
+                <!-- relocate to use grpc-netty-shaded packages -->
+                <relocation>
+                  <pattern>io.netty</pattern>
+                  <shadedPattern>io.grpc.netty.shaded.io.netty</shadedPattern>
+                </relocation>
+              </relocations>
+              <filters>
+                <filter>
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                    
<exclude>META-INF/maven/${project.groupId}/${project.artifactId}/pom.xml</exclude>
+                  </excludes>
+                </filter>
+              </filters>
+              <transformers>
+                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+                <transformer 
implementation="org.apache.maven.plugins.shade.resource.PluginXmlResourceTransformer"/>
+                <transformer 
implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
+                  
<resource>META-INF/maven/${project.groupId}/${project.artifactId}/pom.xml</resource>
+                  <file>${project.basedir}/dependency-reduced-pom.xml</file>
+                </transformer>
+              </transformers>
+              <!-- required for IntelliJ support -->
+              <shadedArtifactAttached>true</shadedArtifactAttached>
+              <shadedClassifierName>shaded</shadedClassifierName>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <!-- required for IntelliJ support, for some reason 
shadedArtifactAttached isn't sufficient alone -->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-shaded-jar</id>
+            <phase>package</phase>
+            <goals>
+              <goal>attach-artifact</goal>
+            </goals>
+            <configuration>
+              <artifacts>
+                <artifact>
+                  
<file>${project.build.directory}/${project.artifactId}-${project.version}-shaded.jar</file>
+                  <type>jar</type>
+                  <classifier>shaded</classifier>
+                </artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <!-- required for running tests in subproject -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>${maven-antrun-plugin.version}</version>
+        <executions>
+          <execution>
+            <id>unpack-shaded-jar</id>
+            <phase>package</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <target>
+                <unzip 
src="${project.build.directory}/${project.artifactId}-${project.version}-shaded.jar"
+                       dest="${project.build.outputDirectory}"
+                       overwrite="true" />
+              </target>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/pom.xml b/pom.xml
index 1514b7da13a..71562619c18 100644
--- a/pom.xml
+++ b/pom.xml
@@ -148,7 +148,7 @@ flexible messaging model and an intuitive client 
API.</description>
     <snappy.version>1.1.10.5</snappy.version> <!-- ZooKeeper server -->
     <dropwizardmetrics.version>4.1.12.1</dropwizardmetrics.version> <!-- 
ZooKeeper server -->
     <curator.version>5.1.0</curator.version>
-    <netty.version>4.1.108.Final</netty.version>
+    <netty.version>4.1.111.Final</netty.version>
     <netty-iouring.version>0.0.24.Final</netty-iouring.version>
     <jetty.version>9.4.54.v20240208</jetty.version>
     <conscrypt.version>2.5.2</conscrypt.version>
@@ -302,6 +302,7 @@ flexible messaging model and an intuitive client 
API.</description>
     <maven-modernizer-plugin.version>2.3.0</maven-modernizer-plugin.version>
     <maven-shade-plugin>3.4.1</maven-shade-plugin>
     <maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
+    
<build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version>
     <properties-maven-plugin.version>1.1.0</properties-maven-plugin.version>
     <nifi-nar-maven-plugin.version>1.5.0</nifi-nar-maven-plugin.version>
     <maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
@@ -584,6 +585,10 @@ flexible messaging model and an intuitive client 
API.</description>
             <artifactId>jose4j</artifactId>
             <groupId>org.bitbucket.b_c</groupId>
           </exclusion>
+          <exclusion>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-netty</artifactId>
+          </exclusion>
         </exclusions>
       </dependency>
 
@@ -1053,12 +1058,51 @@ flexible messaging model and an intuitive client 
API.</description>
         <groupId>io.etcd</groupId>
         <artifactId>jetcd-core</artifactId>
         <version>${jetcd.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-netty</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
-
       <dependency>
         <groupId>io.etcd</groupId>
         <artifactId>jetcd-test</artifactId>
         <version>${jetcd.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-netty</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>io.etcd</groupId>
+            <artifactId>jetcd-core</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>io.etcd</groupId>
+            <artifactId>jetcd-api</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>io.vertx</groupId>
+            <artifactId>*</artifactId>
+          </exclusion>
+        </exclusions>
+      </dependency>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>jetcd-core-shaded</artifactId>
+        <version>${project.version}</version>
+        <classifier>shaded</classifier>
+        <exclusions>
+          <exclusion>
+            <groupId>io.etcd</groupId>
+            <artifactId>*</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>io.vertx</groupId>
+            <artifactId>*</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
 
       <dependency>
@@ -1152,6 +1196,10 @@ flexible messaging model and an intuitive client 
API.</description>
             <groupId>com.squareup.okio</groupId>
             <artifactId>okio</artifactId>
           </exclusion>
+          <exclusion>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-netty</artifactId>
+          </exclusion>
         </exclusions>
       </dependency>
 
@@ -2142,6 +2190,11 @@ flexible messaging model and an intuitive client 
API.</description>
           <artifactId>docker-maven-plugin</artifactId>
           <version>${docker-maven.version}</version>
         </plugin>
+        <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>build-helper-maven-plugin</artifactId>
+          <version>${build-helper-maven-plugin.version}</version>
+        </plugin>
       </plugins>
     </pluginManagement>
     <extensions>
@@ -2387,6 +2440,7 @@ flexible messaging model and an intuitive client 
API.</description>
         <module>pulsar-client-messagecrypto-bc</module>
 
         <module>pulsar-metadata</module>
+        <module>jetcd-core-shaded</module>
         <module>jclouds-shaded</module>
 
         <!-- package management releated modules (begin) -->
@@ -2452,7 +2506,7 @@ flexible messaging model and an intuitive client 
API.</description>
         <!-- all these modules should be put at the end in this exact sequence 
-->
         <module>distribution</module>
         <module>pulsar-metadata</module>
-
+        <module>jetcd-core-shaded</module>
         <!-- package management releated modules (begin) -->
         <module>pulsar-package-management</module>
         <!-- package management releated modules (end) -->
diff --git a/pulsar-broker/pom.xml b/pulsar-broker/pom.xml
index 73f55710c4f..20117ed21db 100644
--- a/pulsar-broker/pom.xml
+++ b/pulsar-broker/pom.xml
@@ -484,6 +484,18 @@
       <version>${project.version}</version>
     </dependency>
 
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>jetcd-core-shaded</artifactId>
+      <version>${project.version}</version>
+      <classifier>shaded</classifier>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>io.grpc</groupId>
+      <artifactId>grpc-netty-shaded</artifactId>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>io.etcd</groupId>
       <artifactId>jetcd-test</artifactId>
diff --git a/pulsar-functions/instance/pom.xml 
b/pulsar-functions/instance/pom.xml
index 99a87963f47..160885a8ea4 100644
--- a/pulsar-functions/instance/pom.xml
+++ b/pulsar-functions/instance/pom.xml
@@ -101,7 +101,7 @@
       <exclusions>
         <exclusion>
           <groupId>io.grpc</groupId>
-          <artifactId>grpc-all</artifactId>
+          <artifactId>*</artifactId>
         </exclusion>
         <exclusion>
           <groupId>com.google.protobuf</groupId>
@@ -110,6 +110,11 @@
       </exclusions>
     </dependency>
 
+    <dependency>
+      <groupId>io.grpc</groupId>
+      <artifactId>grpc-netty-shaded</artifactId>
+    </dependency>
+
     <dependency>
       <groupId>io.grpc</groupId>
       <artifactId>grpc-stub</artifactId>
@@ -215,7 +220,7 @@
           </execution>
         </executions>
       </plugin>
-      
+
       <!-- this task is used for copy all python files together to provide a 
instance directory
            for running python instance -->
       <plugin>
diff --git a/pulsar-metadata/pom.xml b/pulsar-metadata/pom.xml
index f2566fac653..e4a4dd5ec46 100644
--- a/pulsar-metadata/pom.xml
+++ b/pulsar-metadata/pom.xml
@@ -122,10 +122,15 @@
     </dependency>
 
     <dependency>
-      <groupId>io.etcd</groupId>
-      <artifactId>jetcd-core</artifactId>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>jetcd-core-shaded</artifactId>
+      <version>${project.version}</version>
+      <classifier>shaded</classifier>
+    </dependency>
+    <dependency>
+      <groupId>io.grpc</groupId>
+      <artifactId>grpc-netty-shaded</artifactId>
     </dependency>
-
 
     <dependency>
       <groupId>io.etcd</groupId>
diff --git 
a/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/EtcdMetadataStore.java
 
b/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/EtcdMetadataStore.java
index 194b0d6a2f8..3937fd712dc 100644
--- 
a/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/EtcdMetadataStore.java
+++ 
b/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/EtcdMetadataStore.java
@@ -43,10 +43,10 @@ import io.etcd.jetcd.watch.WatchEvent;
 import io.etcd.jetcd.watch.WatchResponse;
 import io.grpc.Status;
 import io.grpc.StatusRuntimeException;
-import io.grpc.netty.GrpcSslContexts;
+import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts;
+import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext;
+import io.grpc.netty.shaded.io.netty.handler.ssl.SslProvider;
 import io.grpc.stub.StreamObserver;
-import io.netty.handler.ssl.SslContext;
-import io.netty.handler.ssl.SslProvider;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;

Reply via email to