Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/src/main/scala/org/apache/spark/util/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ private[spark] object Utils extends Logging {
if (dir.exists() || !dir.mkdirs()) {
dir = null
} else {
if (!chmod700(dir)) {
// Restrict file permissions via chmod if available.
// For Windows this step is ignored.
if (!isWindows && !chmod700(dir)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we swapped the order of these conditionals so that we first attempt to change the permissions and then ignore failures if we're running on Windows? Would that work, or would it fail with an exception?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the current ordering seems more intuitive, so I'm going to keep the patch in its current form.

dir.delete()
dir = null
}
Expand Down