LuciferYang commented on code in PR #49357:
URL: https://github.com/apache/spark/pull/49357#discussion_r1903333213
##########
common/utils/src/main/java/org/apache/spark/network/util/JavaUtils.java:
##########
@@ -156,6 +156,18 @@ private static void deleteRecursivelyUsingJavaIO(
}
}
+ /**
+ * Reads basic attributes of a given file, of return null if an I/O error
occurs.
+ */
+ private static BasicFileAttributes readFileAttributes(File file) {
+ try {
+ return Files.readAttributes(
Review Comment:
cc @dongjoon-hyun
1. If the inode itself does not exist, it will not be possible to read the
`BasicFileAttributes`.
2. If it is a corrupted symbolic link, the `BasicFileAttributes` can be
read, but `file.exists()` will return false.
It seems that scenario 1 was not covered before. I found that the code has
logic that attempts to delete a potentially existing target before writing.
For example:
https://github.com/apache/spark/blob/91f3fdd25852b43095dd5273358fc394ffd11b66/core/src/main/scala/org/apache/spark/SparkContext.scala#L1879-L1888
Let's test it on macOS first.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]