Skip to content
Snippets Groups Projects
Commit 49fe8797 authored by Liang-Chi Hsieh's avatar Liang-Chi Hsieh Committed by Josh Rosen
Browse files

[SPARK-4597] Use proper exception and reset variable in Utils.createTempDir()

`File.exists()` and `File.mkdirs()` only throw `SecurityException` instead of `IOException`. Then, when an exception is thrown, `dir` should be reset too.

Author: Liang-Chi Hsieh <viirya@gmail.com>

Closes #3449 from viirya/fix_createtempdir and squashes the following commits:

36cacbd [Liang-Chi Hsieh] Use proper exception and reset variable.
parent 48223d88
No related branches found
No related tags found
No related merge requests found
...@@ -262,7 +262,7 @@ private[spark] object Utils extends Logging { ...@@ -262,7 +262,7 @@ private[spark] object Utils extends Logging {
if (dir.exists() || !dir.mkdirs()) { if (dir.exists() || !dir.mkdirs()) {
dir = null dir = null
} }
} catch { case e: IOException => ; } } catch { case e: SecurityException => dir = null; }
} }
registerShutdownDeleteDir(dir) registerShutdownDeleteDir(dir)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment