Skip to content

[SPARK-14736][core] Deadlock in registering applications while the Master is in the RECOVERING mode #12506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
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