Skip to content

Commit

Permalink
retryTimer -> registrationRetryTimer
Browse files Browse the repository at this point in the history
  • Loading branch information
markhamstra committed Apr 30, 2014
1 parent 69c348c commit 11cc088
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private[spark] class AppClient(
var master: ActorSelection = null
var alreadyDisconnected = false // To avoid calling listener.disconnected() multiple times
var alreadyDead = false // To avoid calling listener.dead() multiple times
var retryTimer: Option[Cancellable] = None
var registrationRetryTimer: Option[Cancellable] = None

override def preStart() {
context.system.eventStream.subscribe(self, classOf[RemotingLifecycleEvent])
Expand All @@ -86,11 +86,11 @@ private[spark] class AppClient(
tryRegisterAllMasters()
import context.dispatcher
var retries = 0
retryTimer = Some {
registrationRetryTimer = Some {
context.system.scheduler.schedule(REGISTRATION_TIMEOUT, REGISTRATION_TIMEOUT) {
retries += 1
if (registered) {
retryTimer.foreach(_.cancel())
registrationRetryTimer.foreach(_.cancel())
} else if (retries >= REGISTRATION_RETRIES) {
logError("All masters are unresponsive! Giving up.")
markDead()
Expand Down Expand Up @@ -181,7 +181,7 @@ private[spark] class AppClient(
}

override def postStop() {
retryTimer.foreach(_.cancel())
registrationRetryTimer.foreach(_.cancel())
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private[spark] class Worker(
val metricsSystem = MetricsSystem.createMetricsSystem("worker", conf, securityMgr)
val workerSource = new WorkerSource(this)

var retryTimer: Option[Cancellable] = None
var registrationRetryTimer: Option[Cancellable] = None

def coresFree: Int = cores - coresUsed
def memoryFree: Int = memory - memoryUsed
Expand Down Expand Up @@ -166,11 +166,11 @@ private[spark] class Worker(
def registerWithMaster() {
tryRegisterAllMasters()
var retries = 0
retryTimer = Some {
registrationRetryTimer = Some {
context.system.scheduler.schedule(REGISTRATION_TIMEOUT, REGISTRATION_TIMEOUT) {
retries += 1
if (registered) {
retryTimer.foreach(_.cancel())
registrationRetryTimer.foreach(_.cancel())
} else if (retries >= REGISTRATION_RETRIES) {
logError("All masters are unresponsive! Giving up.")
System.exit(1)
Expand Down Expand Up @@ -347,7 +347,7 @@ private[spark] class Worker(
}

override def postStop() {
retryTimer.foreach(_.cancel())
registrationRetryTimer.foreach(_.cancel())
executors.values.foreach(_.kill())
drivers.values.foreach(_.kill())
webUi.stop()
Expand Down

0 comments on commit 11cc088

Please sign in to comment.