HDFS-17946. Several HDFS client integer configs report raw NumberForm…#8593
Open
LiuZheng-Z wants to merge 1 commit into
Open
HDFS-17946. Several HDFS client integer configs report raw NumberForm…#8593LiuZheng-Z wants to merge 1 commit into
LiuZheng-Z wants to merge 1 commit into
Conversation
|
💔 -1 overall
This message was automatically generated. |
…atException for out-of-range values.
|
🎊 +1 overall
This message was automatically generated. |
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
This PR fixes HDFS-17946.
When several HDFS client integer configuration values are set to out-of-range
values (e.g.
-4294967296, which exceeds theintrange of-2147483648 ~ 2147483647), the underlyingConfigurationclass throws a rawNumberFormatExceptionwithout identifying the offending config key:This makes it hard for users to figure out which property is misconfigured.
The fix wraps the
Integer.parseInt/Long.parseLong/Float.parseFloatcalls in
Configuration.getInt,Configuration.getInts,Configuration.getLongandConfiguration.getFloatwith atry/catchsothat the thrown
NumberFormatExceptionincludes the config key name and theinvalid value, e.g.:
Affected configs (from HDFS-17946)
dfs.client.block.write.retriesdfs.client.pipeline.recovery.max-retriesdfs.client.retry.max.attemptsdfs.client.congestion.backoff.mean.timeChanges
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.javagetInt(String, int)– wrap parsing intry/catchgetInts(String)– wrap parsing intry/catch(includes array index)getLong(String, long)– wrap parsing intry/catchgetFloat(String, float)– wrap parsing intry/catchhadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfiguration.javatestGetIntOutOfRange,testGetIntsOutOfRange,testGetLongOutOfRange,testGetFloatOutOfRangecovering the newbehavior and the exact value
-4294967296reported in the JIRA.