Github user aarondav commented on a diff in the pull request:
https://github.com/apache/spark/pull/5392#discussion_r33519086
--- Diff: core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala
---
@@ -258,41 +299,65 @@ private[worker] class Worker(
}
}
+ /**
+ * Cancel last registeration retry, or do nothing if no retry
+ */
+ private def cancelLastRegistrationRetry(): Unit = {
+ if (registerMasterFutures != null) {
+ registerMasterFutures.foreach(_.cancel(true))
+ registerMasterFutures = null
+ }
+ registrationRetryTimer.foreach(_.cancel(true))
+ registrationRetryTimer = None
+ }
+
private def registerWithMaster() {
- // DisassociatedEvent may be triggered multiple times, so don't
attempt registration
+ // onDisconnected may be triggered multiple times, so don't attempt
registration
// if there are outstanding registration attempts scheduled.
registrationRetryTimer match {
case None =>
registered = false
- tryRegisterAllMasters()
+ registerMasterFutures = tryRegisterAllMasters()
connectionAttemptCount = 0
- registrationRetryTimer = Some {
-
context.system.scheduler.schedule(INITIAL_REGISTRATION_RETRY_INTERVAL,
- INITIAL_REGISTRATION_RETRY_INTERVAL, self,
ReregisterWithMaster)
- }
+ registrationRetryTimer =
Some(forwordMessageScheduler.scheduleAtFixedRate(new Runnable {
--- End diff --
The indentation of this block is a little sketchy, maybe we can put the
`new Runnable` on the next line?
---
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]