You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by jo...@apache.org on 2014/11/29 03:05:40 UTC

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

Repository: spark
Updated Branches:
  refs/heads/master 48223d881 -> 49fe8797e


[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 <vi...@gmail.com>

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

36cacbd [Liang-Chi Hsieh] Use proper exception and reset variable.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/49fe8797
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/49fe8797
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/49fe8797

Branch: refs/heads/master
Commit: 49fe8797e64f10c574e0790b32a8c3fdc7e594a0
Parents: 48223d8
Author: Liang-Chi Hsieh <vi...@gmail.com>
Authored: Fri Nov 28 18:04:05 2014 -0800
Committer: Josh Rosen <jo...@databricks.com>
Committed: Fri Nov 28 18:04:15 2014 -0800

----------------------------------------------------------------------
 core/src/main/scala/org/apache/spark/util/Utils.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/49fe8797/core/src/main/scala/org/apache/spark/util/Utils.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala
index eb4a598..336b079 100644
--- a/core/src/main/scala/org/apache/spark/util/Utils.scala
+++ b/core/src/main/scala/org/apache/spark/util/Utils.scala
@@ -262,7 +262,7 @@ private[spark] object Utils extends Logging {
         if (dir.exists() || !dir.mkdirs()) {
           dir = null
         }
-      } catch { case e: IOException => ; }
+      } catch { case e: SecurityException => dir = null; }
     }
 
     registerShutdownDeleteDir(dir)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org