HDFS-17957. Shut down leaked mini-cluster instances and review timeout values in hadoop-hdfs-project tests. - #8659
Open
joseluisll wants to merge 3 commits into
Open
Conversation
… race in TestFsVolumeList. getAddReplicaForkPoolSize() now returns getParallelism() instead of the lazily grown getPoolSize(). It is @VisibleForTesting with no production callers. Contains content generated by Claude Code. Generated-by: Claude Code (Opus 5) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
shfshihuafeng
approved these changes
Aug 5, 2026
shfshihuafeng
suggested changes
Aug 5, 2026
shfshihuafeng
left a comment
There was a problem hiding this comment.
I accidentally approved this PR by mistake.
Author
|
It is almost finished. I left in draft because I would like to give it a second review before putting it as ready and get back to you.🏗 |
joseluisll
marked this pull request as ready for review
August 6, 2026 14:28
joseluisll
force-pushed
the
HDFS-17957-cluster-leak
branch
from
August 6, 2026 17:13
a33994e to
8722fba
Compare
|
💔 -1 overall
This message was automatically generated. |
…oject tests. 65 cases in 41 files: hadoop-hdfs (36), hadoop-hdfs-rbf (4), hadoop-hdfs-nfs (1). Test-only. Contains content generated by Claude Code. Generated-by: Claude Code (Opus 5) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Four mis-calibrated timeout budgets, and a per-method timeout default for hadoop-hdfs (600s) and hadoop-hdfs-rbf (1800s). Test-only. Contains content generated by Claude Code. Generated-by: Claude Code (Opus 5) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
joseluisll
force-pushed
the
HDFS-17957-cluster-leak
branch
from
August 7, 2026 05:26
8722fba to
a0f999d
Compare
Contributor
|
Thanks to involve me here. It's really a big PR, I need time to review it, the good news is most of them are test classes which will not bring any harm to core logic. I will finish to review till next Friday. Thanks again. |
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.
Description of PR
Shuts down 67 leaked mini-cluster instances across 42 test files in
hadoop-hdfs-project, fixes an assertion race in
TestFsVolumeList, and correctsmis-calibrated test timeout budgets.
A leaked cluster holds NameNode and DataNode threads, heap and ports open for
the rest of the class, so one real failure produces several bogus ones. The 67
cases are: never shut down (22), shut down only on the happy path so the leak
happens exactly when the test fails (36), and held in a field with no teardown
(9). The fixes are
try-with-resources,shutdown()infinally, or@AfterEach.TestFsVolumeListneeded a second, unrelated fix.testAddRplicaProcessorForAddingReplicaInMapcompares the configured pool sizeagainst
BlockPoolSlice#getAddReplicaForkPoolSize(), which returnedForkJoinPool#getPoolSize()— threads started so far, which the pool growslazily. That is the
expected: <5> but was: <4>failure. The@VisibleForTestinggetter now returnsgetParallelism(). This is the onlysrc/mainchange and the method has no production callers.TestNNWithQJM#testNewNamenodeTakesOverWritergets a tolerant shutdown. Thetest leaves its NameNode fenced behind a second cluster holding the journal
quorum, so closing the edit log terminates the JVM with "Could not sync enough
journals to persistent storage" — which is why the shutdown was commented out.
It now runs inside a
try/catchthat tolerates that, so the rest of the classno longer runs under a live fenced NameNode.
TestFetchImagestays as trunk has it. Same fenced-shutdown problem, but ithas a single
@Test, so teardown protects nothing and only breaks a class thatpasses today.
Timeouts. Four
@Timeoutvalues were written in milliseconds as if seconds:30000,30000,300000and100000become 30, 30, 300 and 100. Threebudgets were shorter than the waits they wrap —
TestBalancerWithHANameNodes×2 and
TestStandbyCheckpoints#testCheckpointCancellationDuringUpload, 60s →300s.
TestBlockRecoveryCauseStandbyNameNodeCrashmoves off fixed ports50070-73 onto ephemeral ones. Both poms gain
junit.jupiter.execution.timeout.default: 600s for hadoop-hdfs, 1800s forhadoop-hdfs-rbf, whose fork budget is 3600s because its methods legitimately run
long. The default is additive — a hang in a method with no explicit
@Timeoutnow fails as a named per-method timeout instead of a surefire fork kill that
discards the whole class's results, and existing
@Timeoutvalues areunchanged.
The remaining survey candidates are in the JIRA: 4 need no fix by design, 4 were
scan false positives, 11 are outside hadoop-hdfs-project.
How was this patch tested?
Every touched test class was run on Ubuntu 24.04 with JDK
17.0.19+10-1-24.04.2-Ubuntu, the same JDK and OS as the precommit agents:For code changes:
LICENSE… — N/AAI Tooling
Contains content generated by Claude Code.
https://www.apache.org/legal/generative-tooling.html