Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/2408#discussion_r17600258
--- Diff:
core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala
---
@@ -111,13 +112,21 @@ final class ShuffleBlockFetcherIterator(
blockTransferService.fetchBlocks(req.address.host, req.address.port,
blockIds,
new BlockFetchingListener {
override def onBlockFetchSuccess(blockId: String, data:
ManagedBuffer): Unit = {
- results.put(new FetchResult(BlockId(blockId), sizeMap(blockId),
- () => serializer.newInstance().deserializeStream(
- blockManager.wrapForCompression(BlockId(blockId),
data.inputStream())).asIterator
- ))
- shuffleMetrics.remoteBytesRead += data.size
- shuffleMetrics.remoteBlocksFetched += 1
- logDebug("Got remote block " + blockId + " after " +
Utils.getUsedTimeMs(startTime))
+ var is: InputStream = null
+ try {
+ is = data.inputStream()
+ results.put(new FetchResult(BlockId(blockId), sizeMap(blockId),
+ () => serializer.newInstance().deserializeStream(
+ blockManager.wrapForCompression(BlockId(blockId),
is)).asIterator
+ ))
+ shuffleMetrics.remoteBytesRead += data.size
--- End diff --
These three lines do not need to be within the `try` block, right? I figure
it's best to complete the `try` block and have `is` be closed before moving on
to further operations.
---
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]