Skip to content

Commit

Permalink
Merge pull request #2 from hardmettle/configTimeoutUpdates_6980
Browse files Browse the repository at this point in the history
[SPARK-6980] [CORE] [WIP] Creating wrapper for Akka timeout exceptions to get better information using conf (RPC Layer)
  • Loading branch information
BryanCutler committed May 24, 2015
2 parents a294569 + 4be3a8d commit b7fb99f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions core/src/main/scala/org/apache/spark/rpc/RpcEnv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,17 @@ object RpcTimeout {
require(timeoutPropList.nonEmpty)

// Find the first set property or use the default value with the first property
val foundProp = timeoutPropList.view.map(x => (x, conf.getOption(x))).filter(_._2.isDefined).
map(y => (y._1, y._2.get)).headOption.getOrElse(timeoutPropList.head, defaultValue)

val timeout = { Utils.timeStringAsSeconds(foundProp._2) seconds }
new RpcTimeout(timeout, messagePrefix + foundProp._1)
val itr = timeoutPropList.iterator
var foundProp = None: Option[(String, String)]
while (itr.hasNext && foundProp.isEmpty){
val propKey = itr.next()
conf.getOption(propKey) match {
case Some(prop) => foundProp = Some(propKey,prop)
case None =>
}
}
val finalProp = foundProp.getOrElse(timeoutPropList.head, defaultValue)
val timeout = { Utils.timeStringAsSeconds(finalProp._2) seconds }
new RpcTimeout(timeout, messagePrefix + finalProp._1)
}
}

0 comments on commit b7fb99f

Please sign in to comment.