Github user mridulm commented on a diff in the pull request: https://github.com/apache/spark/pull/604#discussion_r12257245 --- Diff: core/src/main/scala/org/apache/spark/storage/DiskBlockManager.scala --- @@ -71,13 +71,13 @@ private[spark] class DiskBlockManager(shuffleManager: ShuffleBlockManager, rootD // Create the subdirectory if it doesn't already exist var subDir = subDirs(dirId)(subDirId) - if (subDir == null) { + val newDir = new File(localDirs(dirId), "%02x".format(subDirId)) + if (subDir == null || !newDir.exists) { subDir = subDirs(dirId).synchronized { val old = subDirs(dirId)(subDirId) - if (old != null) { + if (old != null && newDir.exists) { old } else { - val newDir = new File(localDirs(dirId), "%02x".format(subDirId)) newDir.mkdir() --- End diff -- This entire codepath is buggy for other reasons - which I should be resolving in a different PR anyway. Btw, this change does not fix things - you are just going to face DCL issues which making getFile very expensive (and it is a common operation).
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---