HDFS-17945. Validate HDFS user home directory prefix - #8648
Open
johntomcat7408-cmyk wants to merge 1 commit into
Open
HDFS-17945. Validate HDFS user home directory prefix#8648johntomcat7408-cmyk wants to merge 1 commit into
johntomcat7408-cmyk wants to merge 1 commit into
Conversation
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
HDFS-17945 reports a
NullPointerExceptionwhile initializing an HDFSFileSystemwith invalid configuration. Isolating the reproduction shows that the trigger is a relativedfs.user.home.dir.prefix, rather than the checkpoint-directory setting also present in the example.DistributedFileSystemqualifies the configured home directory before its working directory has been initialized. This patch validates the assembled HDFS user home directory at the shared client configuration boundary and reports anIllegalArgumentExceptioncontaining the configuration key and invalid value when the result is not absolute.The regression test covers the default and a custom absolute prefix, the direct invalid-prefix error, and the complete
FileSystem.newInstanceinitialization path. The change does not modify checkpoint configuration, genericPathbehavior, public APIs, dependencies, protocols, or default configuration.The implementation was derived from the Jira reproduction and merged Hadoop trunk source. It does not reuse an open or unmerged pull request implementation.
How was this patch tested?
./mvnw -pl hadoop-hdfs-project/hadoop-hdfs -am -Dtest=TestDFSUtil#testUserHomeDirectoryPrefix -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false -DskipShade -DskipDocs -P=-native-win testTestDFSUtilclass executed the new test successfully. The report had 40 non-skipped tests pass, 1 skipped test, and 1 environment error in the pre-existingtestGetPasswordbecausehadoop-common/target/bin/winutilsis unavailable on this Windows host; this is not represented as a fully green class run.checkstyle:checkcompleted forhadoop-hdfs-clientandhadoop-hdfs; the changed lines have 0 Checkstyle violations. The aggregate report also lists 12,610 pre-existing unsuppressed violations and usesfailOnViolation=false, so its zero exit status is not represented as a clean module-wide result.git diff --checkpassed.For code changes:
LICENSE,LICENSE-binary, orNOTICE-binaryupdates are applicable.AI Tooling
Contains content generated by Codex.
https://www.apache.org/legal/generative-tooling.html