srowen commented on a change in pull request #23638: [SPARK-26713][CORE]
Interrupt pipe IO threads in PipedRDD when task is finished
URL: https://github.com/apache/spark/pull/23638#discussion_r250834029
##########
File path:
core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala
##########
@@ -489,8 +489,12 @@ final class ShuffleBlockFetcherIterator(
fetchUpToMaxBytes()
}
- currentResult = result.asInstanceOf[SuccessFetchResult]
- (currentResult.blockId, new BufferReleasingInputStream(input, this))
+ if (result != null) {
+ currentResult = result.asInstanceOf[SuccessFetchResult]
+ (currentResult.blockId, new BufferReleasingInputStream(input, this))
+ } else { // the iterator has already be closed
+ throw new NoSuchElementException
Review comment:
Tiny nit: `new NoSuchElementException()` You could also ...
```
if (result == null) {
throw ..
}
```
but doesn't really matter, maybe just slightly cleaner to follow.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]