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

zhangduo pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-3 by this push:
     new 189e4ab899b HBASE-29117 Kerby version conflict with Hadoop 3.4 (#6674)
189e4ab899b is described below

commit 189e4ab899bf293e1d54441b50de4c013d732070
Author: Duo Zhang <[email protected]>
AuthorDate: Fri Feb 14 22:02:34 2025 +0800

    HBASE-29117 Kerby version conflict with Hadoop 3.4 (#6674)
    
    Use hadoop-minikdc instead of depending on kerby directly
    
    Signed-off-by: Andrew Purtell <[email protected]>
    Signed-off-by: Istvan Toth <[email protected]>
    (cherry picked from commit d59814c8233aff4dc3bf431f63de9dfbaeb70fb6)
---
 hbase-asyncfs/pom.xml                              | 10 -----
 hbase-common/pom.xml                               | 10 ++---
 .../hadoop/hbase/util/SimpleKdcServerUtil.java     | 10 ++---
 hbase-http/pom.xml                                 | 16 --------
 hbase-rest/pom.xml                                 | 10 -----
 hbase-server/pom.xml                               | 10 -----
 hbase-testing-util/pom.xml                         | 16 --------
 hbase-thrift/pom.xml                               |  5 ---
 pom.xml                                            | 44 ++++++++++++++--------
 9 files changed, 36 insertions(+), 95 deletions(-)

diff --git a/hbase-asyncfs/pom.xml b/hbase-asyncfs/pom.xml
index 4e729906e86..6c43ade3023 100644
--- a/hbase-asyncfs/pom.xml
+++ b/hbase-asyncfs/pom.xml
@@ -78,16 +78,6 @@
       <artifactId>bcprov-jdk18on</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.apache.kerby</groupId>
-      <artifactId>kerb-client</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.kerby</groupId>
-      <artifactId>kerb-simplekdc</artifactId>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>org.apache.hbase</groupId>
       <artifactId>hbase-http</artifactId>
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index 2f8f6d40399..99624527bf2 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -165,11 +165,6 @@
       <artifactId>log4j-slf4j-impl</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.apache.kerby</groupId>
-      <artifactId>kerb-simplekdc</artifactId>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>org.bouncycastle</groupId>
       <artifactId>bcprov-jdk18on</artifactId>
@@ -349,6 +344,11 @@
           <groupId>org.apache.hadoop</groupId>
           <artifactId>hadoop-common</artifactId>
         </dependency>
+        <dependency>
+          <groupId>org.apache.hadoop</groupId>
+          <artifactId>hadoop-minikdc</artifactId>
+          <scope>test</scope>
+        </dependency>
       </dependencies>
       <build>
         <plugins>
diff --git 
a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/SimpleKdcServerUtil.java
 
b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/SimpleKdcServerUtil.java
index fa3172e3b14..d1ac19bd8ad 100644
--- 
a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/SimpleKdcServerUtil.java
+++ 
b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/SimpleKdcServerUtil.java
@@ -19,7 +19,6 @@ package org.apache.hadoop.hbase.util;
 
 import java.io.File;
 import java.io.IOException;
-import java.net.BindException;
 import java.net.InetAddress;
 import java.util.function.Supplier;
 import org.apache.hadoop.hbase.net.BoundSocketMaker;
@@ -85,12 +84,9 @@ public final class SimpleKdcServerUtil {
         if (kdc != null) {
           kdc.stop();
         }
-        if (ke.getCause() != null && ke.getCause() instanceof BindException) {
-          LOG.info("Clashed using port {}; getting a new random port", 
kdcPort);
-          continue;
-        } else {
-          throw ke;
-        }
+        // new kerby just eats the cause exception so we can not test for 
BindException any more.
+        // the only way is to always retry...
+        LOG.info("Failed to init/start kdc server, retry = {}", i, ke);
       } finally {
         if (bsm != null) {
           bsm.close();
diff --git a/hbase-http/pom.xml b/hbase-http/pom.xml
index f229270a47d..60288f49519 100644
--- a/hbase-http/pom.xml
+++ b/hbase-http/pom.xml
@@ -100,21 +100,11 @@
       <optional>true</optional>
     </dependency>
     <!-- Test dependencies -->
-    <dependency>
-      <groupId>org.apache.kerby</groupId>
-      <artifactId>kerb-simplekdc</artifactId>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>org.bouncycastle</groupId>
       <artifactId>bcprov-jdk18on</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.apache.kerby</groupId>
-      <artifactId>kerb-core</artifactId>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>org.apache.httpcomponents</groupId>
       <artifactId>httpclient</artifactId>
@@ -425,12 +415,6 @@
           <groupId>org.apache.hadoop</groupId>
           <artifactId>hadoop-minikdc</artifactId>
           <scope>test</scope>
-          <exclusions>
-            <exclusion>
-              <groupId>org.apache.directory.api</groupId>
-              <artifactId>api-all</artifactId>
-            </exclusion>
-          </exclusions>
         </dependency>
       </dependencies>
       <build>
diff --git a/hbase-rest/pom.xml b/hbase-rest/pom.xml
index ba76571c66e..0ccd1723b34 100644
--- a/hbase-rest/pom.xml
+++ b/hbase-rest/pom.xml
@@ -193,16 +193,6 @@
       <groupId>org.apache.tomcat</groupId>
       <artifactId>tomcat-jasper</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.apache.kerby</groupId>
-      <artifactId>kerb-simplekdc</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.kerby</groupId>
-      <artifactId>kerb-core</artifactId>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
diff --git a/hbase-server/pom.xml b/hbase-server/pom.xml
index 7a1176c261d..f6c7a66d5ff 100644
--- a/hbase-server/pom.xml
+++ b/hbase-server/pom.xml
@@ -260,16 +260,6 @@
       <artifactId>hamcrest-library</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.apache.kerby</groupId>
-      <artifactId>kerb-client</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.kerby</groupId>
-      <artifactId>kerb-simplekdc</artifactId>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>org.apache.httpcomponents</groupId>
       <artifactId>httpclient</artifactId>
diff --git a/hbase-testing-util/pom.xml b/hbase-testing-util/pom.xml
index 968b2a8c1c0..d3d5bf9ef11 100644
--- a/hbase-testing-util/pom.xml
+++ b/hbase-testing-util/pom.xml
@@ -211,22 +211,6 @@
           <groupId>org.apache.hadoop</groupId>
           <artifactId>hadoop-minikdc</artifactId>
           <scope>compile</scope>
-          <exclusions>
-            <exclusion>
-              <groupId>bouncycastle</groupId>
-              <artifactId>bcprov-jdk15</artifactId>
-            </exclusion>
-          </exclusions>
-        </dependency>
-        <dependency>
-          <groupId>org.apache.kerby</groupId>
-          <artifactId>kerb-client</artifactId>
-          <scope>compile</scope>
-        </dependency>
-        <dependency>
-          <groupId>org.apache.kerby</groupId>
-          <artifactId>kerb-simplekdc</artifactId>
-          <scope>compile</scope>
         </dependency>
       </dependencies>
     </profile>
diff --git a/hbase-thrift/pom.xml b/hbase-thrift/pom.xml
index 4f6ccfd18be..40f58205aab 100644
--- a/hbase-thrift/pom.xml
+++ b/hbase-thrift/pom.xml
@@ -108,11 +108,6 @@
       <groupId>org.apache.tomcat</groupId>
       <artifactId>tomcat-jasper</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.apache.kerby</groupId>
-      <artifactId>kerb-simplekdc</artifactId>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>jcl-over-slf4j</artifactId>
diff --git a/pom.xml b/pom.xml
index 80cd2aa10cb..b85129d69d2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -869,7 +869,6 @@
     <spy.version>2.12.3</spy.version>
     <bouncycastle.version>1.78</bouncycastle.version>
     <skyscreamer.version>1.5.1</skyscreamer.version>
-    <kerby.version>1.0.1</kerby.version>
     <commons-crypto.version>1.1.0</commons-crypto.version>
     <curator.version>4.2.0</curator.version>
     <!-- Plugin Dependencies -->
@@ -1666,21 +1665,6 @@
         <version>${bouncycastle.version}</version>
         <scope>test</scope>
       </dependency>
-      <dependency>
-        <groupId>org.apache.kerby</groupId>
-        <artifactId>kerb-core</artifactId>
-        <version>${kerby.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.kerby</groupId>
-        <artifactId>kerb-client</artifactId>
-        <version>${kerby.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.kerby</groupId>
-        <artifactId>kerb-simplekdc</artifactId>
-        <version>${kerby.version}</version>
-      </dependency>
       <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-crypto</artifactId>
@@ -3855,6 +3839,14 @@
                 <groupId>org.slf4j</groupId>
                 <artifactId>slf4j-reload4j</artifactId>
               </exclusion>
+              <exclusion>
+                <groupId>jline</groupId>
+                <artifactId>jline</artifactId>
+              </exclusion>
+              <exclusion>
+                <groupId>org.jline</groupId>
+                <artifactId>jline</artifactId>
+              </exclusion>
             </exclusions>
           </dependency>
           <dependency>
@@ -4062,6 +4054,14 @@
               </exclusion>
             </exclusions>
           </dependency>
+          <!--
+            We use hadoop-minikdc everywhere instead of depending on kerby is
+            because hadoop upgrade kerby version in hadoop 3.4.x and kerby 1.x
+            and 2.x are not compatible, so if we specify the version of kerby
+            in our pom will cause compile/runtime error while compiling against
+            different hadoop versions, and also cause problem for downstream
+            projects. See HBASE-29117 for more details.
+          -->
           <dependency>
             <groupId>org.apache.hadoop</groupId>
             <artifactId>hadoop-minikdc</artifactId>
@@ -4084,6 +4084,18 @@
                 <groupId>bouncycastle</groupId>
                 <artifactId>bcprov-jdk15</artifactId>
               </exclusion>
+              <exclusion>
+                <groupId>org.apache.directory.api</groupId>
+                <artifactId>api-all</artifactId>
+              </exclusion>
+              <exclusion>
+                <groupId>jline</groupId>
+                <artifactId>jline</artifactId>
+              </exclusion>
+              <exclusion>
+                <groupId>org.jline</groupId>
+                <artifactId>jline</artifactId>
+              </exclusion>
             </exclusions>
           </dependency>
           <dependency>

Reply via email to