Github user WangTaoTheTonic commented on the pull request:
https://github.com/apache/spark/pull/3841#issuecomment-69307655
@andrewor14
In `SparkContext.scala`, we have:
>private[spark] val env = SparkEnv.createDriverEnv(conf, isLocal,
listenerBus)
And during creating SparkEnv, we have:
> val (actorSystem, boundPort) = {
val actorSystemName = if (isDriver) driverActorSystemName else
executorActorSystemName
AkkaUtils.createActorSystem(actorSystemName, hostname, port, conf,
securityManager)
}
`AkaUtils.createActorSystem' will use
>Utils.startServiceOnPort(port, startService, name)
So before SparkEnv is created and set, `Utils.startServiceOnPort` is
already used. So even we change `portMaxRetries` to a `def`,
`Option(SparkEnv.get)` will get a `None`.
>val portMaxRetries: Int = {
if (sys.props.contains("spark.testing")) {
// Set a higher number of retries for tests...
sys.props.get("spark.port.maxRetries").map(_.toInt).getOrElse(100)
} else {
Option(SparkEnv.get)
.flatMap(_.conf.getOption("spark.port.maxRetries"))
.map(_.toInt)
.getOrElse(16)
}
}
---
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]