Github user zsxwing commented on a diff in the pull request:
https://github.com/apache/spark/pull/5392#discussion_r29378265
--- Diff: core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala
---
@@ -181,24 +189,31 @@ private[worker] class Worker(
metricsSystem.getServletHandlers.foreach(webUi.attachHandler)
}
- private def changeMaster(url: String, uiUrl: String) {
+ private def changeMaster(masterRef: RpcEndpointRef, uiUrl: String) {
// activeMasterUrl it's a valid Spark url since we receive it from
master.
- activeMasterUrl = url
+ activeMasterUrl = masterRef.address.toSparkURL
activeMasterWebUiUrl = uiUrl
- master = context.actorSelection(
- Master.toAkkaUrl(activeMasterUrl,
AkkaUtils.protocol(context.system)))
- masterAddress = Master.toAkkaAddress(activeMasterUrl,
AkkaUtils.protocol(context.system))
+ master = Some(masterRef)
connected = true
// Cancel any outstanding re-registration attempts because we found a
new master
- registrationRetryTimer.foreach(_.cancel())
- registrationRetryTimer = None
+ cancelLastRegistrationRetry()
}
- private def tryRegisterAllMasters() {
- for (masterAkkaUrl <- masterAkkaUrls) {
- logInfo("Connecting to master " + masterAkkaUrl + "...")
- val actor = context.actorSelection(masterAkkaUrl)
- actor ! RegisterWorker(workerId, host, port, cores, memory,
webUi.boundPort, publicAddress)
+ private def tryRegisterAllMasters(): Array[Future[_]] = {
--- End diff --
Future => JFuture
---
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]