[
https://issues.apache.org/jira/browse/HDFS-17951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18100642#comment-18100642
]
ASF GitHub Bot commented on HDFS-17951:
---------------------------------------
joseluisll opened a new pull request, #8645:
URL: https://github.com/apache/hadoop/pull/8645
### 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:
- [x] 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
- [x] Contains content generated by Claude Code.
- [x] My use of AI contributions follows the ASF legal policy
https://www.apache.org/legal/generative-tooling.html
🤖 Generated with [Claude Code](https://claude.com/claude-code)
> TestFsVolumeList#testAddRplicaProcessorForAddingReplicaInMap fails.
> -------------------------------------------------------------------
>
> Key: HDFS-17951
> URL: https://issues.apache.org/jira/browse/HDFS-17951
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: test
> Reporter: fuchaohong
> Priority: Major
>
> Currently, it fails with below IOException.
> {code:java}
> [ERROR] Failures:
> [ERROR]
> org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.TestFsVolumeList.testAddRplicaProcessorForAddingReplicaInMap
> [ERROR] Run 1:
> TestFsVolumeList.testAddRplicaProcessorForAddingReplicaInMap:422 Fork pool
> should be initialize with configured pool size ==> expected: <5> but was: <4>
> [ERROR] Run 2:
> TestFsVolumeList.testAddRplicaProcessorForAddingReplicaInMap:422 Fork pool
> should be initialize with configured pool size ==> expected: <5> but was: <4>
> [ERROR] Run 3:
> TestFsVolumeList.testAddRplicaProcessorForAddingReplicaInMap:422 Fork pool
> should be initialize with configured pool size ==> expected: <5> but was: <4>
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]