Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/11241#discussion_r55606187
--- Diff: core/src/main/scala/org/apache/spark/storage/BlockManager.scala
---
@@ -570,28 +577,49 @@ private[spark] class BlockManager(
preferredLocs ++ otherLocs
}
- private def doGetRemote(blockId: BlockId, asBlockResult: Boolean):
Option[Any] = {
+ /**
+ * VisibleForTesting
+ */
+ private[spark] def doGetRemote(blockId: BlockId, blockTransferService:
BlockTransferService,
+ asBlockResult: Boolean): Option[Any] = {
require(blockId != null, "BlockId is null")
+ var runningFailureCount = 0
+ var totalFailureCount = 0
val locations = getLocations(blockId)
- var numFetchFailures = 0
- for (loc <- locations) {
+ val maxFetchFailures = locations.size
+ var locationIterator = locations.iterator
+ while (locationIterator.hasNext) {
--- End diff --
just a thought: would this be easier to reason about as a tail-recursive
method? would eliminate the need for the vars and returns.
---
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]