Skip to content

HDFS-17951. Fix TestFsVolumeList#testAddRplicaProcessorForAddingReplicaInMap. - #8645

Open
joseluisll wants to merge 1 commit into
apache:trunkfrom
joseluisll:HDFS-17951
Open

HDFS-17951. Fix TestFsVolumeList#testAddRplicaProcessorForAddingReplicaInMap.#8645
joseluisll wants to merge 1 commit into
apache:trunkfrom
joseluisll:HDFS-17951

Conversation

@joseluisll

Copy link
Copy Markdown

Description of PR

TestFsVolumeList#testAddRplicaProcessorForAddingReplicaInMap fails in some environments with "Fork pool should be initialize with configured pool size ==> expected: <5> but was: <4>".

The test assumes the fork-join pool always holds as many threads as the configured pool size. That assumption is false: ForkJoinPool creates worker threads on demand, so getPoolSize() depends on the load of the environment and can be lower than the configured parallelism.

What the test can verify deterministically is the pool's configuration. The fix changes the @VisibleForTesting accessor BlockPoolSlice#getAddReplicaForkPoolSize() to return getParallelism(), the configured value. No production behavior changes; the assertion in TestFsVolumeList is the accessor's only caller.

How was this patch tested?

TestFsVolumeList#testAddRplicaProcessorForAddingReplicaInMap and #testInstanceOfAddReplicaThreadPool pass locally (Windows 11, JDK 17, 24 cores). A standalone probe replicating the production submit/fork pattern (ForkJoinPool(5), two external submits, forked non-joining subtasks) showed getPoolSize() returning 4 in 15/15 runs under light task demand while getParallelism() returned 5 in all runs — reproducing the reported failure signature and confirming the fix asserts a deterministic quantity.

For code changes:

  • Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: N/A
  • New dependencies: N/A — no dependencies added
  • LICENSE / LICENSE-binary / NOTICE-binary: N/A — no updates needed

AI Tooling

🤖 Generated with Claude Code

…caInMap by asserting the pool's configured parallelism.

ForkJoinPool.getPoolSize() returns the number of worker threads that
have spawned, which tracks task demand and varies by environment;
getParallelism() deterministically returns the configured pool size
the assertion intends to verify.

Contains content generated by Claude Code.

Generated-by: Claude Code (claude-fable-5)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 33s 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 doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 40m 50s trunk passed
+1 💚 compile 1m 49s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 compile 1m 47s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 checkstyle 1m 49s trunk passed
+1 💚 mvnsite 1m 58s trunk passed
+1 💚 javadoc 1m 36s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 1m 32s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 4m 10s trunk passed
+1 💚 shadedclient 32m 0s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 1m 22s the patch passed
+1 💚 compile 1m 15s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javac 1m 15s the patch passed
+1 💚 compile 1m 17s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 javac 1m 17s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 15s the patch passed
+1 💚 mvnsite 1m 26s the patch passed
+1 💚 javadoc 1m 0s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 1m 1s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 3m 51s the patch passed
+1 💚 shadedclient 30m 51s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 217m 51s hadoop-hdfs in the patch passed.
+1 💚 asflicense 0m 47s The patch does not generate ASF License warnings.
348m 16s
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8645/2/artifact/out/Dockerfile
GITHUB PR #8645
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux d2605ca1a0ea 5.15.0-181-generic #191-Ubuntu SMP Fri May 22 19:09:02 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / b34cc85
Default Java Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.11+10-1-24.04.2-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8645/2/testReport/
Max. process+thread count 4080 (vs. ulimit of 10000)
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-8645/2/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 14m 17s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s 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 doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 46m 27s trunk passed
+1 💚 compile 1m 40s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 compile 1m 46s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 checkstyle 1m 53s trunk passed
+1 💚 mvnsite 1m 53s trunk passed
+1 💚 javadoc 1m 43s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 1m 29s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 4m 16s trunk passed
+1 💚 shadedclient 31m 51s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 1m 22s the patch passed
+1 💚 compile 1m 15s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javac 1m 15s the patch passed
+1 💚 compile 1m 18s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 javac 1m 18s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 15s the patch passed
+1 💚 mvnsite 1m 24s the patch passed
+1 💚 javadoc 0m 59s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 1m 1s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 3m 47s the patch passed
+1 💚 shadedclient 30m 32s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 222m 36s hadoop-hdfs in the patch passed.
+1 💚 asflicense 0m 47s The patch does not generate ASF License warnings.
371m 24s
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8645/1/artifact/out/Dockerfile
GITHUB PR #8645
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux fdc4fba37687 5.15.0-177-generic #187-Ubuntu SMP Sat Apr 11 22:54:33 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / b34cc85
Default Java Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.11+10-1-24.04.2-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8645/1/testReport/
Max. process+thread count 3532 (vs. ulimit of 10000)
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-8645/1/console
versions git=2.43.0 maven=3.9.15 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.

2 participants