Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion core/src/main/scala/org/apache/spark/deploy/master/Master.scala
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ private[deploy] class Master(
val idToApp = new HashMap[String, ApplicationInfo]
private val waitingApps = new ArrayBuffer[ApplicationInfo]
val apps = new HashSet[ApplicationInfo]
private val waitingAppsWhileRecovering = new ArrayBuffer[ApplicationInfo]

private val idToWorker = new HashMap[String, WorkerInfo]
private val addressToWorker = new HashMap[RpcAddress, WorkerInfo]
Expand Down Expand Up @@ -571,6 +572,9 @@ private[deploy] class Master(
}

state = RecoveryState.ALIVE
// Re-register the apps which were omitted during the Recovering phase.
waitingAppsWhileRecovering.foreach(registerApplication)
waitingAppsWhileRecovering.clear()
schedule()
logInfo("Recovery complete - resuming operations!")
}
Expand Down Expand Up @@ -818,7 +822,13 @@ private[deploy] class Master(
private def registerApplication(app: ApplicationInfo): Unit = {
val appAddress = app.driver.address
if (addressToApp.contains(appAddress)) {
logInfo("Attempted to re-register application at same address: " + appAddress)
if (state == RecoveryState.RECOVERING) {
logInfo("Attempted to re-register application at same address: " + appAddress + " in the " +
"Recovering Mode")
waitingAppsWhileRecovering += app
} else {
logInfo("Attempted to re-register application at same address: " + appAddress)
}
return
}

Expand Down