You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by srowen <gi...@git.apache.org> on 2014/12/09 14:06:17 UTC

[GitHub] spark pull request: [SPARK-4792] Add error message when making loc...

Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3635#discussion_r21526216
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/DiskBlockManager.scala ---
    @@ -67,11 +67,29 @@ private[spark] class DiskBlockManager(blockManager: BlockManager, conf: SparkCon
         if (subDir == null) {
           subDir = subDirs(dirId).synchronized {
             val old = subDirs(dirId)(subDirId)
    -        if (old != null) {
    +        if (old != null && old.exists()) {
               old
             } else {
    +          var foundLocalDir = false
    +          var tries = 0
               val newDir = new File(localDirs(dirId), "%02x".format(subDirId))
    -          newDir.mkdir()
    +          while (!foundLocalDir && tries < MAX_DIR_CREATION_ATTEMPTS) {
    +            tries += 1
    +            try {
    +              if (!newDir.exists()) {
    +                foundLocalDir = newDir.mkdir()
    --- End diff --
    
    Why keep retrying this? what's the case where it fails but then immediately succeeds?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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