Skip to content

HDFS-17824. DataNode fails to start when dfs.datanode.directoryscan.t…#8309

Open
deepujain wants to merge 1 commit intoapache:trunkfrom
deepujain:HDFS-17824-directoryscan-threads-validation
Open

HDFS-17824. DataNode fails to start when dfs.datanode.directoryscan.t…#8309
deepujain wants to merge 1 commit intoapache:trunkfrom
deepujain:HDFS-17824-directoryscan-threads-validation

Conversation

@deepujain
Copy link
Copy Markdown
Contributor

Summary

When dfs.datanode.directoryscan.threads is set to 0 or a negative value, the DataNode throws IllegalArgumentException from Executors.newFixedThreadPool(threads) during DirectoryScanner initialization and fails to start. This change validates the config and uses the default (1) when the value is non-positive, with a warning log, so the DataNode starts and the operator sees a clear message.

Change

  • DirectoryScanner: After reading dfs.datanode.directoryscan.threads, if the value is ≤ 0, log a warning (parameter name, invalid value, default) and set threads to DFS_DATANODE_DIRECTORYSCAN_THREADS_DEFAULT (1) before creating the thread pool. Matches the existing pattern used for reconcile.blocks.batch.size and reconcile.blocks.batch.interval in the same class.
  • TestDirectoryScanner: New test testInvalidDirectoryScanThreadsUsesDefault() — set directoryscan.threads to 0, build a minimal cluster, create and start DirectoryScanner; verifies no exception and scanner runs (HDFS-17824).

JIRA

Fixes HDFS-17824

@hadoop-yetus
Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 0s Docker mode activated.
-1 ❌ patch 0m 16s #8309 does not apply to trunk. Rebase required? Wrong Branch? See https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute for help.
Subsystem Report/Notes
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8309/1/console
versions git=2.34.1
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@deepujain deepujain force-pushed the HDFS-17824-directoryscan-threads-validation branch from 15fe655 to 032cd21 Compare March 8, 2026 05:12
@deepujain deepujain force-pushed the HDFS-17824-directoryscan-threads-validation branch 2 times, most recently from 1de9f63 to 686548d Compare March 27, 2026 05:31
@hadoop-yetus
Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 21s 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 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 27m 29s trunk passed
+1 💚 compile 0m 52s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 compile 0m 54s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 checkstyle 0m 57s trunk passed
+1 💚 mvnsite 1m 0s trunk passed
+1 💚 javadoc 0m 48s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 0m 49s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 2m 20s trunk passed
+1 💚 shadedclient 18m 44s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 43s the patch passed
+1 💚 compile 0m 40s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javac 0m 40s the patch passed
+1 💚 compile 0m 43s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 javac 0m 43s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 39s the patch passed
+1 💚 mvnsite 0m 46s the patch passed
+1 💚 javadoc 0m 35s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 0m 37s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 2m 12s the patch passed
+1 💚 shadedclient 18m 41s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 181m 41s /patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt hadoop-hdfs in the patch passed.
+1 💚 asflicense 0m 27s The patch does not generate ASF License warnings.
261m 1s
Reason Tests
Failed junit tests hadoop.hdfs.server.balancer.TestBalancerWithHANameNodes
Subsystem Report/Notes
Docker ClientAPI=1.54 ServerAPI=1.54 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8309/5/artifact/out/Dockerfile
GITHUB PR #8309
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux b207aecd7bf6 5.15.0-171-generic #181-Ubuntu SMP Fri Feb 6 22:44:50 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 1de9f63
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-8309/5/testReport/
Max. process+thread count 4640 (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-8309/5/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.

@hadoop-yetus
Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 19s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s 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 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 27m 33s trunk passed
+1 💚 compile 0m 53s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 compile 0m 55s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 checkstyle 0m 55s trunk passed
+1 💚 mvnsite 0m 59s trunk passed
+1 💚 javadoc 0m 50s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 0m 47s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 2m 7s trunk passed
+1 💚 shadedclient 18m 53s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 46s the patch passed
+1 💚 compile 0m 39s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javac 0m 39s the patch passed
+1 💚 compile 0m 43s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 javac 0m 43s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 41s the patch passed
+1 💚 mvnsite 0m 46s the patch passed
+1 💚 javadoc 0m 33s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 0m 34s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 2m 1s the patch passed
+1 💚 shadedclient 19m 30s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 184m 51s /patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt hadoop-hdfs in the patch passed.
+1 💚 asflicense 0m 31s The patch does not generate ASF License warnings.
265m 32s
Reason Tests
Failed junit tests hadoop.hdfs.server.balancer.TestBalancerWithHANameNodes
Subsystem Report/Notes
Docker ClientAPI=1.54 ServerAPI=1.54 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8309/6/artifact/out/Dockerfile
GITHUB PR #8309
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 9f4f461cdce5 5.15.0-171-generic #181-Ubuntu SMP Fri Feb 6 22:44:50 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 686548d
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-8309/6/testReport/
Max. process+thread count 3936 (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-8309/6/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.

@deepujain deepujain force-pushed the HDFS-17824-directoryscan-threads-validation branch from 686548d to 21d2f16 Compare March 27, 2026 16:01
@deepujain
Copy link
Copy Markdown
Contributor Author

Rebased onto current apache/trunk and force-pushed the branch.

Local verification:

  • TestBalancerWithHANameNodes passes locally.
  • TestDirectoryScanner hit a local failure in testThrottling ("Throttle is too permissive"), which does not match the remaining Yetus failure.

Current branch head: 21d2f16.

@hadoop-yetus
Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 22s 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 appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 35m 27s trunk passed
+1 💚 compile 0m 56s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 compile 1m 6s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 checkstyle 1m 6s trunk passed
+1 💚 mvnsite 1m 8s trunk passed
+1 💚 javadoc 0m 48s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 0m 49s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 2m 28s trunk passed
+1 💚 shadedclient 22m 9s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 56s the patch passed
+1 💚 compile 0m 48s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javac 0m 48s the patch passed
+1 💚 compile 0m 53s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 javac 0m 53s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 54s the patch passed
+1 💚 mvnsite 0m 57s the patch passed
+1 💚 javadoc 0m 41s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 0m 38s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 2m 19s the patch passed
-1 ❌ shadedclient 5m 38s patch has errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 0m 56s /patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt hadoop-hdfs in the patch failed.
+0 🆗 asflicense 0m 9s ASF License check generated no output?
79m 58s
Subsystem Report/Notes
Docker ClientAPI=1.54 ServerAPI=1.54 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8309/7/artifact/out/Dockerfile
GITHUB PR #8309
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 4a6980716b81 5.15.0-171-generic #181-Ubuntu SMP Fri Feb 6 22:44:50 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 21d2f16
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-8309/7/testReport/
Max. process+thread count 605 (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-8309/7/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.

@deepujain deepujain force-pushed the HDFS-17824-directoryscan-threads-validation branch from 21d2f16 to 4e6a6f2 Compare March 28, 2026 18:10
@deepujain
Copy link
Copy Markdown
Contributor Author

Refreshed the branch to a new single-commit SHA and force-pushed so Yetus can rerun cleanly. The latest red unit and shadedclient checks both failed with pthread_create failed (EAGAIN) / unable to create native thread, so they look like CI resource-limit failures rather than patch-specific regressions. Local validation passed with mvn -Dmaven.repo.local=/tmp/codex-m2 test -pl hadoop-hdfs-project/hadoop-hdfs -am -Dtest=TestDirectoryScanner#testInvalidDirectoryScanThreadsUsesDefault,TestBalancerWithHANameNodes -DskipTests=false. Ready for another CI spin.

Copy link
Copy Markdown
Member

@ayushtkn ayushtkn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I have triggered the build again, if it comes green I will merge this

@deepujain deepujain force-pushed the HDFS-17824-directoryscan-threads-validation branch from 4e6a6f2 to ebc7a88 Compare April 22, 2026 00:05
@deepujain
Copy link
Copy Markdown
Contributor Author

Rebased this onto current apache/trunk and force-pushed the refreshed branch. Local validation passed with JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home /opt/homebrew/bin/mvn -Dmaven.repo.local=/tmp/codex-m2 test -pl hadoop-hdfs-project/hadoop-hdfs -am -Dtest=TestDirectoryScanner#testInvalidDirectoryScanThreadsUsesDefault,TestBalancerWithHANameNodes -DskipTests=false (6 tests, 0 failures).

@deepujain deepujain force-pushed the HDFS-17824-directoryscan-threads-validation branch from ebc7a88 to cbeabd2 Compare April 24, 2026 06:08
@deepujain
Copy link
Copy Markdown
Contributor Author

Rebased this onto current apache/trunk again after trunk moved ahead and the GitHub merge check fell back to 'This commit cannot be built'. Force-pushed the refreshed branch at cbeabd2. Local validation passed with JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home /opt/homebrew/bin/mvn -Dmaven.repo.local=/tmp/codex-m2 test -pl hadoop-hdfs-project/hadoop-hdfs -am -Dtest=TestDirectoryScanner#testInvalidDirectoryScanThreadsUsesDefault,TestBalancerWithHANameNodes -DskipTests=false (6 tests, 0 failures).

@hadoop-yetus
Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 54s 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 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 46m 24s trunk passed
+1 💚 compile 1m 42s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 compile 1m 45s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 checkstyle 1m 50s trunk passed
+1 💚 mvnsite 1m 55s trunk passed
+1 💚 javadoc 1m 28s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 1m 29s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 4m 15s trunk passed
+1 💚 shadedclient 37m 13s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 1m 23s the patch passed
+1 💚 compile 1m 16s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javac 1m 16s the patch passed
+1 💚 compile 1m 18s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 javac 1m 18s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 22s the patch passed
+1 💚 mvnsite 1m 28s the patch passed
+1 💚 javadoc 0m 58s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 1m 3s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 4m 5s the patch passed
+1 💚 shadedclient 36m 29s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 262m 17s hadoop-hdfs in the patch passed.
+1 💚 asflicense 0m 50s The patch does not generate ASF License warnings.
409m 28s
Subsystem Report/Notes
Docker ClientAPI=1.54 ServerAPI=1.54 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8309/11/artifact/out/Dockerfile
GITHUB PR #8309
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 05ec1af52ccb 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 / cbeabd2
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-8309/11/testReport/
Max. process+thread count 2510 (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-8309/11/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