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

    https://github.com/apache/spark/pull/6423#discussion_r32050679
  
    --- Diff: 
core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala 
---
    @@ -272,7 +275,7 @@ final class ShuffleBlockFetcherIterator(
     
       override def hasNext: Boolean = numBlocksProcessed < numBlocksToFetch
     
    -  override def next(): (BlockId, Try[Iterator[Any]]) = {
    +  override def next(): (BlockId, Try[InputStream]) = {
    --- End diff --
    
    I just started writing a big comment about why I thought this was 
unnecessary because I thought the `TaskCompletionListener` would take care of 
it for us ... and then I realized that this was necessary so that we release 
buffers as soon as finish with them as we fetch a bunch of blocks.
    
    would you mind adding a small doc here that callers of this class should 
always be sure to wrap the results in a `CompletionIterator` which closes the 
`InputStream`, to be sure buffers are released as soon as possible?  Would help 
callers and future readers of this code


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