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

    https://github.com/apache/spark/pull/11613#discussion_r55896526
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/BlockManager.scala 
---
    @@ -717,8 +717,13 @@ private[spark] class BlockManager(
           level: StorageLevel,
           tellMaster: Boolean = true): Boolean = {
         require(values != null, "Values is null")
    -    // If doPut() didn't hand work back to us, then block already existed 
or was successfully stored
    -    doPutIterator(blockId, () => values, level, tellMaster).isEmpty
    +    doPutIterator(blockId, () => values, level, tellMaster) match {
    +      case None =>
    +        true
    +      case Some(iter) =>
    +        iter.close()
    --- End diff --
    
    can you add a short comment, something like:
    ```
    // caller doesn't care about the iterator values, so we can close the 
iterator here to free resources earlier
    ```


---
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