Skip to content

HDFS-17945. Validate HDFS user home directory prefix - #8648

Open
johntomcat7408-cmyk wants to merge 1 commit into
apache:trunkfrom
johntomcat7408-cmyk:HDFS-17945-home-dir-prefix-validation
Open

HDFS-17945. Validate HDFS user home directory prefix#8648
johntomcat7408-cmyk wants to merge 1 commit into
apache:trunkfrom
johntomcat7408-cmyk:HDFS-17945-home-dir-prefix-validation

Conversation

@johntomcat7408-cmyk

Copy link
Copy Markdown

Description of PR

HDFS-17945 reports a NullPointerException while initializing an HDFS FileSystem with invalid configuration. Isolating the reproduction shows that the trigger is a relative dfs.user.home.dir.prefix, rather than the checkpoint-directory setting also present in the example.

DistributedFileSystem qualifies 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 an IllegalArgumentException containing 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.newInstance initialization path. The change does not modify checkpoint configuration, generic Path behavior, 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?

  • Passed the targeted regression test (1 test; all 12 reactor modules succeeded):
    ./mvnw -pl hadoop-hdfs-project/hadoop-hdfs -am -Dtest=TestDFSUtil#testUserHomeDirectoryPrefix -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false -DskipShade -DskipDocs -P=-native-win test
  • Running the complete TestDFSUtil class executed the new test successfully. The report had 40 non-skipped tests pass, 1 skipped test, and 1 environment error in the pre-existing testGetPassword because hadoop-common/target/bin/winutils is unavailable on this Windows host; this is not represented as a fully green class run.
  • checkstyle:check completed for hadoop-hdfs-client and hadoop-hdfs; the changed lines have 0 Checkstyle violations. The aggregate report also lists 12,610 pre-existing unsuppressed violations and uses failOnViolation=false, so its zero exit status is not represented as a clean module-wide result.
  • git diff --check passed.

For code changes:

  • Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: not applicable; this change only affects HDFS client home-directory configuration.
  • No new dependencies are added.
  • No LICENSE, LICENSE-binary, or NOTICE-binary updates are applicable.

AI Tooling

Contains content generated by Codex.

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.

1 participant