Skip to content

HDFS-17784. Fix port conflicts in TestBlockTokenWrappingQOP and TestMultipleNNPortQOP.#8323

Open
balodesecurity wants to merge 1 commit intoapache:trunkfrom
balodesecurity:HDFS-17784
Open

HDFS-17784. Fix port conflicts in TestBlockTokenWrappingQOP and TestMultipleNNPortQOP.#8323
balodesecurity wants to merge 1 commit intoapache:trunkfrom
balodesecurity:HDFS-17784

Conversation

@balodesecurity
Copy link

Summary

Both TestBlockTokenWrappingQOP and TestMultipleNNPortQOP hardcoded specific TCP ports for the NameNode service-RPC and auxiliary-RPC endpoints:

Test Old service port Old auxiliary ports
TestBlockTokenWrappingQOP 9020 12000
TestMultipleNNPortQOP 9021 12001, 12101, 12201

When these tests run in parallel (common in CI with forked JVMs), or when the OS delays releasing a recently used port, the cluster startup throws a BindException and the test fails transiently.

Fix

Replace every hardcoded port with a dynamically allocated free port:

  • TestBlockTokenWrappingQOP.setup(): allocate 2 ports via NetUtils.getFreeSocketPort(); store the auxiliary port as an instance field so the URI built later references the same value.
  • TestMultipleNNPortQOP.setup(): allocate 4 ports via NetUtils.getFreeSocketPorts(4); store authPort, integrityPort, privacyPort as static fields; update all ingress.port.sasl.* config keys and the three URI references in each test method.

Test plan

  • mvn package -pl hadoop-hdfs-project/hadoop-hdfs -am -DskipTests compiles cleanly ✅
  • No hardcoded port numbers remain in the two modified files ✅
  • Full test run expected to pass on CI (Kerberos environment required for these tests)

…ultipleNNPortQOP.

Both tests hardcoded specific TCP ports for the NameNode service RPC
and auxiliary RPC endpoints. Running these tests in parallel (or
re-running them quickly) caused BindException failures when the OS had
not yet released the previously bound port.

Fix: replace all hardcoded port numbers with dynamically allocated free
ports obtained via NetUtils.getFreeSocketPort() /
NetUtils.getFreeSocketPorts(). All derived configuration keys
(ingress.port.sasl.configured.ports, ingress.port.sasl.prop.*) and
URI references inside test methods are updated to use the same
dynamically chosen values.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 19m 41s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 49m 24s trunk passed
+1 💚 compile 1m 53s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 compile 1m 52s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 checkstyle 1m 50s trunk passed
+1 💚 mvnsite 2m 0s trunk passed
+1 💚 javadoc 1m 30s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 1m 31s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 4m 41s trunk passed
+1 💚 shadedclient 37m 48s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 1m 28s the patch passed
+1 💚 compile 1m 19s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javac 1m 19s the patch passed
+1 💚 compile 1m 24s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 javac 1m 24s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 21s the patch passed
+1 💚 mvnsite 1m 33s the patch passed
+1 💚 javadoc 1m 1s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 1m 6s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 4m 24s the patch passed
+1 💚 shadedclient 36m 48s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 296m 30s /patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt hadoop-hdfs in the patch failed.
+1 💚 asflicense 0m 56s The patch does not generate ASF License warnings.
467m 26s
Reason Tests
Failed junit tests hadoop.hdfs.server.namenode.ha.TestStandbyCheckpoints
Subsystem Report/Notes
Docker ClientAPI=1.54 ServerAPI=1.54 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8323/1/artifact/out/Dockerfile
GITHUB PR #8323
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux f18634719cc7 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 156bbb4
Default Java Ubuntu-17.0.18+8-Ubuntu-124.04.1
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.10+7-Ubuntu-124.04 /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.18+8-Ubuntu-124.04.1
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8323/1/testReport/
Max. process+thread count 3345 (vs. ulimit of 5500)
modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8323/1/console
versions git=2.43.0 maven=3.9.11 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants