HDFS-17784. Fix port conflicts in TestBlockTokenWrappingQOP and TestMultipleNNPortQOP.#8323
Open
balodesecurity wants to merge 1 commit intoapache:trunkfrom
Open
HDFS-17784. Fix port conflicts in TestBlockTokenWrappingQOP and TestMultipleNNPortQOP.#8323balodesecurity wants to merge 1 commit intoapache:trunkfrom
balodesecurity wants to merge 1 commit intoapache:trunkfrom
Conversation
…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>
|
💔 -1 overall
This message was automatically generated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Both
TestBlockTokenWrappingQOPandTestMultipleNNPortQOPhardcoded specific TCP ports for the NameNode service-RPC and auxiliary-RPC endpoints:TestBlockTokenWrappingQOP902012000TestMultipleNNPortQOP902112001,12101,12201When 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
BindExceptionand the test fails transiently.Fix
Replace every hardcoded port with a dynamically allocated free port:
TestBlockTokenWrappingQOP.setup(): allocate 2 ports viaNetUtils.getFreeSocketPort(); store the auxiliary port as an instance field so theURIbuilt later references the same value.TestMultipleNNPortQOP.setup(): allocate 4 ports viaNetUtils.getFreeSocketPorts(4); storeauthPort,integrityPort,privacyPortas static fields; update allingress.port.sasl.*config keys and the threeURIreferences in each test method.Test plan
mvn package -pl hadoop-hdfs-project/hadoop-hdfs -am -DskipTestscompiles cleanly ✅