Skip to content

Commit d59814c

Browse files
authored
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]>
1 parent f37e8ac commit d59814c

File tree

9 files changed

+36
-95
lines changed

9 files changed

+36
-95
lines changed

hbase-asyncfs/pom.xml

-10
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,6 @@
7878
<artifactId>bcprov-jdk18on</artifactId>
7979
<scope>test</scope>
8080
</dependency>
81-
<dependency>
82-
<groupId>org.apache.kerby</groupId>
83-
<artifactId>kerb-client</artifactId>
84-
<scope>test</scope>
85-
</dependency>
86-
<dependency>
87-
<groupId>org.apache.kerby</groupId>
88-
<artifactId>kerb-simplekdc</artifactId>
89-
<scope>test</scope>
90-
</dependency>
9181
<dependency>
9282
<groupId>org.apache.hbase</groupId>
9383
<artifactId>hbase-http</artifactId>

hbase-common/pom.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,6 @@
165165
<artifactId>log4j-slf4j-impl</artifactId>
166166
<scope>test</scope>
167167
</dependency>
168-
<dependency>
169-
<groupId>org.apache.kerby</groupId>
170-
<artifactId>kerb-simplekdc</artifactId>
171-
<scope>test</scope>
172-
</dependency>
173168
<dependency>
174169
<groupId>org.bouncycastle</groupId>
175170
<artifactId>bcprov-jdk18on</artifactId>
@@ -349,6 +344,11 @@
349344
<groupId>org.apache.hadoop</groupId>
350345
<artifactId>hadoop-common</artifactId>
351346
</dependency>
347+
<dependency>
348+
<groupId>org.apache.hadoop</groupId>
349+
<artifactId>hadoop-minikdc</artifactId>
350+
<scope>test</scope>
351+
</dependency>
352352
</dependencies>
353353
<build>
354354
<plugins>

hbase-common/src/test/java/org/apache/hadoop/hbase/util/SimpleKdcServerUtil.java

+3-7
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import java.io.File;
2121
import java.io.IOException;
22-
import java.net.BindException;
2322
import java.net.InetAddress;
2423
import java.util.function.Supplier;
2524
import org.apache.hadoop.hbase.net.BoundSocketMaker;
@@ -85,12 +84,9 @@ static SimpleKdcServer getRunningSimpleKdcServer(File testDir,
8584
if (kdc != null) {
8685
kdc.stop();
8786
}
88-
if (ke.getCause() != null && ke.getCause() instanceof BindException) {
89-
LOG.info("Clashed using port {}; getting a new random port", kdcPort);
90-
continue;
91-
} else {
92-
throw ke;
93-
}
87+
// new kerby just eats the cause exception so we can not test for BindException any more.
88+
// the only way is to always retry...
89+
LOG.info("Failed to init/start kdc server, retry = {}", i, ke);
9490
} finally {
9591
if (bsm != null) {
9692
bsm.close();

hbase-http/pom.xml

-16
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,11 @@
100100
<optional>true</optional>
101101
</dependency>
102102
<!-- Test dependencies -->
103-
<dependency>
104-
<groupId>org.apache.kerby</groupId>
105-
<artifactId>kerb-simplekdc</artifactId>
106-
<scope>test</scope>
107-
</dependency>
108103
<dependency>
109104
<groupId>org.bouncycastle</groupId>
110105
<artifactId>bcprov-jdk18on</artifactId>
111106
<scope>test</scope>
112107
</dependency>
113-
<dependency>
114-
<groupId>org.apache.kerby</groupId>
115-
<artifactId>kerb-core</artifactId>
116-
<scope>test</scope>
117-
</dependency>
118108
<dependency>
119109
<groupId>org.apache.httpcomponents</groupId>
120110
<artifactId>httpclient</artifactId>
@@ -425,12 +415,6 @@
425415
<groupId>org.apache.hadoop</groupId>
426416
<artifactId>hadoop-minikdc</artifactId>
427417
<scope>test</scope>
428-
<exclusions>
429-
<exclusion>
430-
<groupId>org.apache.directory.api</groupId>
431-
<artifactId>api-all</artifactId>
432-
</exclusion>
433-
</exclusions>
434418
</dependency>
435419
</dependencies>
436420
<build>

hbase-rest/pom.xml

-10
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,6 @@
193193
<groupId>org.apache.tomcat</groupId>
194194
<artifactId>tomcat-jasper</artifactId>
195195
</dependency>
196-
<dependency>
197-
<groupId>org.apache.kerby</groupId>
198-
<artifactId>kerb-simplekdc</artifactId>
199-
<scope>test</scope>
200-
</dependency>
201-
<dependency>
202-
<groupId>org.apache.kerby</groupId>
203-
<artifactId>kerb-core</artifactId>
204-
<scope>test</scope>
205-
</dependency>
206196
<dependency>
207197
<groupId>commons-io</groupId>
208198
<artifactId>commons-io</artifactId>

hbase-server/pom.xml

-10
Original file line numberDiff line numberDiff line change
@@ -260,16 +260,6 @@
260260
<artifactId>hamcrest-library</artifactId>
261261
<scope>test</scope>
262262
</dependency>
263-
<dependency>
264-
<groupId>org.apache.kerby</groupId>
265-
<artifactId>kerb-client</artifactId>
266-
<scope>test</scope>
267-
</dependency>
268-
<dependency>
269-
<groupId>org.apache.kerby</groupId>
270-
<artifactId>kerb-simplekdc</artifactId>
271-
<scope>test</scope>
272-
</dependency>
273263
<dependency>
274264
<groupId>org.apache.httpcomponents</groupId>
275265
<artifactId>httpclient</artifactId>

hbase-testing-util/pom.xml

-16
Original file line numberDiff line numberDiff line change
@@ -211,22 +211,6 @@
211211
<groupId>org.apache.hadoop</groupId>
212212
<artifactId>hadoop-minikdc</artifactId>
213213
<scope>compile</scope>
214-
<exclusions>
215-
<exclusion>
216-
<groupId>bouncycastle</groupId>
217-
<artifactId>bcprov-jdk15</artifactId>
218-
</exclusion>
219-
</exclusions>
220-
</dependency>
221-
<dependency>
222-
<groupId>org.apache.kerby</groupId>
223-
<artifactId>kerb-client</artifactId>
224-
<scope>compile</scope>
225-
</dependency>
226-
<dependency>
227-
<groupId>org.apache.kerby</groupId>
228-
<artifactId>kerb-simplekdc</artifactId>
229-
<scope>compile</scope>
230214
</dependency>
231215
</dependencies>
232216
</profile>

hbase-thrift/pom.xml

-5
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,6 @@
108108
<groupId>org.apache.tomcat</groupId>
109109
<artifactId>tomcat-jasper</artifactId>
110110
</dependency>
111-
<dependency>
112-
<groupId>org.apache.kerby</groupId>
113-
<artifactId>kerb-simplekdc</artifactId>
114-
<scope>test</scope>
115-
</dependency>
116111
<dependency>
117112
<groupId>org.slf4j</groupId>
118113
<artifactId>jcl-over-slf4j</artifactId>

pom.xml

+28-16
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,6 @@
893893
<spy.version>2.12.3</spy.version>
894894
<bouncycastle.version>1.78</bouncycastle.version>
895895
<skyscreamer.version>1.5.1</skyscreamer.version>
896-
<kerby.version>1.0.1</kerby.version>
897896
<commons-crypto.version>1.1.0</commons-crypto.version>
898897
<curator.version>4.2.0</curator.version>
899898
<!-- Plugin Dependencies -->
@@ -1690,21 +1689,6 @@
16901689
<version>${bouncycastle.version}</version>
16911690
<scope>test</scope>
16921691
</dependency>
1693-
<dependency>
1694-
<groupId>org.apache.kerby</groupId>
1695-
<artifactId>kerb-core</artifactId>
1696-
<version>${kerby.version}</version>
1697-
</dependency>
1698-
<dependency>
1699-
<groupId>org.apache.kerby</groupId>
1700-
<artifactId>kerb-client</artifactId>
1701-
<version>${kerby.version}</version>
1702-
</dependency>
1703-
<dependency>
1704-
<groupId>org.apache.kerby</groupId>
1705-
<artifactId>kerb-simplekdc</artifactId>
1706-
<version>${kerby.version}</version>
1707-
</dependency>
17081692
<dependency>
17091693
<groupId>org.apache.commons</groupId>
17101694
<artifactId>commons-crypto</artifactId>
@@ -3959,6 +3943,14 @@
39593943
<groupId>org.slf4j</groupId>
39603944
<artifactId>slf4j-reload4j</artifactId>
39613945
</exclusion>
3946+
<exclusion>
3947+
<groupId>jline</groupId>
3948+
<artifactId>jline</artifactId>
3949+
</exclusion>
3950+
<exclusion>
3951+
<groupId>org.jline</groupId>
3952+
<artifactId>jline</artifactId>
3953+
</exclusion>
39623954
</exclusions>
39633955
</dependency>
39643956
<dependency>
@@ -4166,6 +4158,14 @@
41664158
</exclusion>
41674159
</exclusions>
41684160
</dependency>
4161+
<!--
4162+
We use hadoop-minikdc everywhere instead of depending on kerby is
4163+
because hadoop upgrade kerby version in hadoop 3.4.x and kerby 1.x
4164+
and 2.x are not compatible, so if we specify the version of kerby
4165+
in our pom will cause compile/runtime error while compiling against
4166+
different hadoop versions, and also cause problem for downstream
4167+
projects. See HBASE-29117 for more details.
4168+
-->
41694169
<dependency>
41704170
<groupId>org.apache.hadoop</groupId>
41714171
<artifactId>hadoop-minikdc</artifactId>
@@ -4188,6 +4188,18 @@
41884188
<groupId>bouncycastle</groupId>
41894189
<artifactId>bcprov-jdk15</artifactId>
41904190
</exclusion>
4191+
<exclusion>
4192+
<groupId>org.apache.directory.api</groupId>
4193+
<artifactId>api-all</artifactId>
4194+
</exclusion>
4195+
<exclusion>
4196+
<groupId>jline</groupId>
4197+
<artifactId>jline</artifactId>
4198+
</exclusion>
4199+
<exclusion>
4200+
<groupId>org.jline</groupId>
4201+
<artifactId>jline</artifactId>
4202+
</exclusion>
41914203
</exclusions>
41924204
</dependency>
41934205
<dependency>

0 commit comments

Comments
 (0)