squito commented on a change in pull request #25299: [SPARK-27651][Core] Avoid
the network when shuffle blocks are fetched from the same host
URL: https://github.com/apache/spark/pull/25299#discussion_r314365447
##########
File path:
core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala
##########
@@ -379,6 +452,13 @@ final class ShuffleBlockFetcherIterator(
// Get Local Blocks
fetchLocalBlocks()
logDebug(s"Got local blocks in ${Utils.getUsedTimeNs(startTimeNs)}")
+
+ // Get Host-local Blocks
+ if (hostLocalBlocks.nonEmpty) {
+ val hostLocalStartTimeNs = System.nanoTime()
+ fetchHostLocalBlocks()
Review comment:
I think there is a corner case that is missed here. What if there are
*only* host-local blocks, but none of them have any hostLocalDirs available?
You'd put those remote requests in the fetch queue, but you'd never send them
out until a call to `fetchUpToMaxBytes()` inside `next()` -- but you'd never
get there because `next()` would block forever waiting to dequeue.
I think you can fix this just by adding another call to
`fetchUpToMaxBytes()` here. Definitely worth a comment explaining this as well.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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]