Skip to content

HDFS-17946. Several HDFS client integer configs report raw NumberForm…#8593

Open
LiuZheng-Z wants to merge 1 commit into
apache:trunkfrom
LiuZheng-Z:HDFS-17946
Open

HDFS-17946. Several HDFS client integer configs report raw NumberForm…#8593
LiuZheng-Z wants to merge 1 commit into
apache:trunkfrom
LiuZheng-Z:HDFS-17946

Conversation

@LiuZheng-Z

@LiuZheng-Z LiuZheng-Z commented Jul 9, 2026

Copy link
Copy Markdown

Description of PR

This PR fixes HDFS-17946.

When several HDFS client integer configuration values are set to out-of-range
values (e.g. -4294967296, which exceeds the int range of
-2147483648 ~ 2147483647), the underlying Configuration class throws a raw
NumberFormatException without identifying the offending config key:

Failed to initialize filesystem hdfs://127.0.0.1:9000:
java.lang.NumberFormatException: For input string: "-4294967296"

This makes it hard for users to figure out which property is misconfigured.
The fix wraps the Integer.parseInt / Long.parseLong / Float.parseFloat
calls in Configuration.getInt, Configuration.getInts,
Configuration.getLong and Configuration.getFloat with a try/catch so
that the thrown NumberFormatException includes the config key name and the
invalid value, e.g.:

NumberFormatException: Failed to parse value of dfs.client.block.write.retries,
got "-4294967296", expect a valid integer.

Affected configs (from HDFS-17946)

  • dfs.client.block.write.retries
  • dfs.client.pipeline.recovery.max-retries
  • dfs.client.retry.max.attempts
  • dfs.client.congestion.backoff.mean.time

Changes

  • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
    • getInt(String, int) – wrap parsing in try/catch
    • getInts(String) – wrap parsing in try/catch (includes array index)
    • getLong(String, long) – wrap parsing in try/catch
    • getFloat(String, float) – wrap parsing in try/catch
  • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfiguration.java
    • Added testGetIntOutOfRange, testGetIntsOutOfRange,
      testGetLongOutOfRange, testGetFloatOutOfRange covering the new
      behavior and the exact value -4294967296 reported in the JIRA.

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 19m 9s 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 47m 24s trunk passed
+1 💚 compile 18m 50s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 compile 18m 6s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 checkstyle 1m 31s trunk passed
+1 💚 mvnsite 2m 0s trunk passed
+1 💚 javadoc 1m 26s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 1m 24s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 3m 17s trunk passed
+1 💚 shadedclient 37m 22s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
-1 ❌ mvninstall 1m 11s /patch-mvninstall-hadoop-common-project_hadoop-common.txt hadoop-common in the patch failed.
-1 ❌ compile 1m 21s /patch-compile-root-jdkUbuntu-21.0.11+10-1-24.04.2-Ubuntu.txt root in the patch failed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu.
-1 ❌ javac 1m 21s /patch-compile-root-jdkUbuntu-21.0.11+10-1-24.04.2-Ubuntu.txt root in the patch failed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu.
-1 ❌ compile 1m 25s /patch-compile-root-jdkUbuntu-17.0.19+10-1-24.04.2-Ubuntu.txt root in the patch failed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu.
-1 ❌ javac 1m 25s /patch-compile-root-jdkUbuntu-17.0.19+10-1-24.04.2-Ubuntu.txt root in the patch failed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu.
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 1m 0s /results-checkstyle-hadoop-common-project_hadoop-common.txt hadoop-common-project/hadoop-common: The patch generated 4 new + 215 unchanged - 0 fixed = 219 total (was 215)
-1 ❌ mvnsite 1m 9s /patch-mvnsite-hadoop-common-project_hadoop-common.txt hadoop-common in the patch failed.
+1 💚 javadoc 0m 55s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 56s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
-1 ❌ spotbugs 1m 6s /patch-spotbugs-hadoop-common-project_hadoop-common.txt hadoop-common in the patch failed.
-1 ❌ shadedclient 10m 21s patch has errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 1m 11s /patch-unit-hadoop-common-project_hadoop-common.txt hadoop-common in the patch failed.
+1 💚 asflicense 0m 30s The patch does not generate ASF License warnings.
165m 32s
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8593/1/artifact/out/Dockerfile
GITHUB PR #8593
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 32e8516789d6 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 / 69dfb45
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-8593/1/testReport/
Max. process+thread count 563 (vs. ulimit of 10000)
modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8593/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.

@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 58s trunk passed
+1 💚 compile 18m 25s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 compile 18m 13s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 checkstyle 1m 30s trunk passed
+1 💚 mvnsite 2m 0s trunk passed
+1 💚 javadoc 1m 24s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 1m 22s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 3m 13s trunk passed
+1 💚 shadedclient 36m 32s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 1m 15s the patch passed
+1 💚 compile 16m 39s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javac 16m 39s the patch passed
+1 💚 compile 18m 10s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 javac 18m 10s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 1m 27s /results-checkstyle-hadoop-common-project_hadoop-common.txt hadoop-common-project/hadoop-common: The patch generated 4 new + 215 unchanged - 0 fixed = 219 total (was 215)
+1 💚 mvnsite 1m 53s the patch passed
+1 💚 javadoc 1m 20s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 1m 22s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 3m 23s the patch passed
+1 💚 shadedclient 37m 7s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 23m 33s hadoop-common in the patch passed.
+1 💚 asflicense 1m 12s The patch does not generate ASF License warnings.
239m 13s
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8593/2/artifact/out/Dockerfile
GITHUB PR #8593
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 463aa0fa48f6 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 / 65c8ff4
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-8593/2/testReport/
Max. process+thread count 1470 (vs. ulimit of 10000)
modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8593/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.

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