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

    https://github.com/apache/spark/pull/5223#discussion_r27353652
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/ShuffleMapTask.scala ---
    @@ -62,22 +63,15 @@ private[spark] class ShuffleMapTask(
     
         metrics = Some(context.taskMetrics)
         var writer: ShuffleWriter[Any, Any] = null
    -    try {
    +    Utils.tryWithSafeFinally {
           val manager = SparkEnv.get.shuffleManager
           writer = manager.getWriter[Any, Any](dep.shuffleHandle, partitionId, 
context)
           writer.write(rdd.iterator(partition, 
context).asInstanceOf[Iterator[_ <: Product2[Any, Any]]])
           return writer.stop(success = true).get
    -    } catch {
    -      case e: Exception =>
    -        try {
    -          if (writer != null) {
    -            writer.stop(success = false)
    -          }
    -        } catch {
    -          case e: Exception =>
    -            log.debug("Could not stop writer", e)
    -        }
    -        throw e
    +    } {
    --- End diff --
    
    The code was not closing the writer before during normal execution, so this 
is good. However, this change also means that it will stop with success = false 
whether an error occurred or not, and will do so even after stop was called 
with success = true. This one may not fit the pattern.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to