mnpoonia commented on code in PR #8604:
URL: https://github.com/apache/hbase/pull/8604#discussion_r3939741061
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java:
##########
@@ -3731,21 +3732,51 @@ public MiniKdc setupMiniKdc(File keytabFile) throws
Exception {
dir = new File(getDataTestDir("kdc").toUri().getPath());
kdc = new MiniKdc(conf, dir);
kdc.start();
- } catch (BindException e) {
+ } catch (Exception e) {
+ // Catch Exception, not BindException/KrbException: Kerby wraps the
bind failure in a
+ // KrbException whose shape varies by version (see isBindException),
so we recognise the
+ // port conflict via that predicate rather than a type. We also avoid
importing kerby types
+ // here (see HBASE-29117).
+ if (!isBindException(e)) {
+ throw e; // not a port conflict, do not mask the real failure behind
a retry
Review Comment:
Good catch — fixed in 70eb936: moved `FileUtils.deleteDirectory(dir)` ahead
of the `isBindException` check so the partially-initialized kdc dir is cleaned
up before rethrowing on any failure, not just on a retried bind conflict.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]