-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HADOOP-19599. Fix file permission errors as per the platform #7767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
HADOOP-19599. Fix file permission errors as per the platform #7767
Conversation
* The file permission denial error message in Linux systems end with `(Permission denied)` particularly. * However, an error message in the same scenario on Windows ends with an `(Access is denied)` error. * This PR fixes the resulting bug in `org.apache.hadoop.fs.ChecksumFileSystem.ChecksumFSInputChecker` and also fixes the unit test failure `org.apache.hadoop.fs.TestFsShellCopy#testPutSrcFileNoPerm` by making the appropriate check in accordance with the platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes file permission error messages in Hadoop by adjusting the logic for both Windows and Linux platforms. Key changes include:
- Updating the unit test in TestFsShellCopy to assert platform-specific error messages.
- Refactoring ChecksumFileSystem to use a helper method (isPermissionDenied) for detecting permission denied errors.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
hadoop-common/src/test/java/org/apache/hadoop/fs/TestFsShellCopy.java | Adjusts error message assertion to handle Windows "(Access is denied)" and Linux "(Permission denied)" messages. |
hadoop-common/src/main/java/org/apache/hadoop/fs/ChecksumFileSystem.java | Introduces a helper method to encapsulate permission denied error detection based on platform. |
🎊 +1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description of PR
(Permission denied)
particularly.(Access is denied)
error.org.apache.hadoop.fs.ChecksumFileSystem.ChecksumFSInputChecker
and also fixes the unit test failureorg.apache.hadoop.fs.TestFsShellCopy#testPutSrcFileNoPerm
by making the appropriate check in accordance with the platform.How was this patch tested?
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?