dongjoon-hyun commented on a change in pull request #33101:
URL: https://github.com/apache/spark/pull/33101#discussion_r659484186
##########
File path: core/src/main/scala/org/apache/spark/util/Utils.scala
##########
@@ -310,15 +306,17 @@ private[spark] object Utils extends Logging {
while (dir == null) {
attempts += 1
if (attempts > maxAttempts) {
- throw new IOException("Failed to create a temp directory (under " +
root + ") after " +
- maxAttempts + " attempts!")
+ throw new IOException(s"Failed to create a temp directory (under
$root) after " +
+ s"$maxAttempts attempts!")
}
try {
dir = new File(root, namePrefix + "-" + UUID.randomUUID.toString)
- if (dir.exists() || !dir.mkdirs()) {
- dir = null
- }
- } catch { case e: SecurityException => dir = null; }
+ // SPARK-35907 Instead of File#mkdirs, Files#createDirectories is
expected.
+ Files.createDirectories(dir.toPath)
+ } catch { case e: Exception =>
Review comment:
I meant to use a more specific Exception instead of `Ignoring the
exception`.
--
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]