Github user aarondav commented on a diff in the pull request:
https://github.com/apache/spark/pull/5392#discussion_r33518468
--- Diff: core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala
---
@@ -235,21 +250,47 @@ private[worker] class Worker(
* still not safe if the old master recovers within this interval,
but this is a much
* less likely scenario.
*/
- if (master != null) {
- master ! RegisterWorker(
- workerId, host, port, cores, memory, webUi.boundPort,
publicAddress)
- } else {
- // We are retrying the initial registration
- tryRegisterAllMasters()
+ master match {
+ case Some(masterRef) =>
+ // registered == false && master != None means we lost the
connection to master, so
+ // masterRef cannot be used and we need to recreate it again.
Note: we must not set
+ // master to None due to the above comments.
+ if (registerMasterFutures != null) {
+ registerMasterFutures.foreach(_.cancel(true))
+ }
+ val masterAddress = masterRef.address
+ registerMasterFutures =
Array(registerMasterThreadPool.submit(new Runnable {
+ override def run(): Unit =
--- End diff --
nit: braces
---
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]