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

    https://github.com/apache/spark/pull/20422#discussion_r164635886
  
    --- Diff: 
core/src/main/scala/org/apache/spark/shuffle/IndexShuffleBlockResolver.scala ---
    @@ -166,8 +153,20 @@ private[spark] class IndexShuffleBlockResolver(
               if (dataTmp != null && dataTmp.exists()) {
                 dataTmp.delete()
               }
    -          indexTmp.delete()
             } else {
    +          val out = new DataOutputStream(new BufferedOutputStream(new 
FileOutputStream(indexTmp)))
    --- End diff --
    
    move this below the comment "This is the first successul attempt".
    
    I'd also include a comment about why we write to a temporary file, even 
though we're always going to rename (because in case the task dies somehow, 
we'd prefer to not leave a half-written index file in the final location).


---

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

Reply via email to