Skip to content

Commit ce72c72

Browse files
lianchengpwendell
authored andcommitted
[Bugfix] Tachyon file cleanup logical error
Should lookup `shutdownDeleteTachyonPaths` instead of `shutdownDeletePaths`. Together with a minor style clean up: `find {...}.isDefined` to `exists {...}`. Author: Cheng Lian <[email protected]> Closes #575 from liancheng/tachyonFix and squashes the following commits: deb8f31 [Cheng Lian] Fixed logical error in when cleanup Tachyon files and minor style cleanup
1 parent 11d5494 commit ce72c72

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

core/src/main/scala/org/apache/spark/util/Utils.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ private[spark] object Utils extends Logging {
220220
def hasRootAsShutdownDeleteDir(file: File): Boolean = {
221221
val absolutePath = file.getAbsolutePath()
222222
val retval = shutdownDeletePaths.synchronized {
223-
shutdownDeletePaths.find { path =>
223+
shutdownDeletePaths.exists { path =>
224224
!absolutePath.equals(path) && absolutePath.startsWith(path)
225-
}.isDefined
225+
}
226226
}
227227
if (retval) {
228228
logInfo("path = " + file + ", already present as root for deletion.")
@@ -235,10 +235,10 @@ private[spark] object Utils extends Logging {
235235
// paths - resulting in Exception and incomplete cleanup.
236236
def hasRootAsShutdownDeleteDir(file: TachyonFile): Boolean = {
237237
val absolutePath = file.getPath()
238-
val retval = shutdownDeletePaths.synchronized {
239-
shutdownDeletePaths.find { path =>
238+
val retval = shutdownDeleteTachyonPaths.synchronized {
239+
shutdownDeleteTachyonPaths.exists { path =>
240240
!absolutePath.equals(path) && absolutePath.startsWith(path)
241-
}.isDefined
241+
}
242242
}
243243
if (retval) {
244244
logInfo("path = " + file + ", already present as root for deletion.")

0 commit comments

Comments
 (0)