-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-41943][CORE] Use java api to create files and grant permissions #39448
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
Conversation
| * Create a directory that is writable by the group. | ||
| * Grant the permission 770 "rwxrwx---" to the directory so the shuffle server can | ||
| * create subdirs/files within the merge folder. | ||
| * TODO: Find out why can't we create a dir using java api with permission 770 |
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.
For TODO, maybe we can see https://bugs.openjdk.org/browse/JDK-8220013
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.
Mind summarizing why we can use this approach while the JDK issue isn't resolved?
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.
In unix like systems every process has a property called umask which is masked onto the permissions of any file created and inherited by child processes. the default is 0002 or "turn off write for others". So it's most likely that Java is setting the permission you seek and then it's being masked out. At present, this issue has not been resolved, so my current approach is to create a directory first, and then explicitly grant permissions.
|
+CC @zhouyejoe |
|
cc @cloud-fan @HyukjinKwon @LuciferYang @@zhouyejoe Hope to get your opinion. :) |
|
There was a long discussion thread regarding this implementation in this PR. There will be some issue with setgid. |
Thank you for reminding me @zhouyejoe . I looked at the results of the discussion and it seems to be consistent with my handling method. You can see #35085 (comment) |
|
Yeah I think this is fine. |
|
Could you take another look for this? @mridulm @zhouyejoe @HyukjinKwon @Kimahriman @cloud-fan THX! |
|
Can one of the admins verify this patch? |
|
thanks, merging to master! |
|
Thanks all. @mridulm @zhouyejoe @Kimahriman @HyukjinKwon @cloud-fan |
What changes were proposed in this pull request?
For method
createDirWithPermission770, using java api to create files and grant permissions instead of calling shell commands.Why are the changes needed?
Safer and more efficient.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Origin uts.