Skip to content

Commit

Permalink
[SPARK-6602][Core]Remove unnecessary synchronized
Browse files Browse the repository at this point in the history
A follow-up pr to address #5392 (comment)

Author: zsxwing <zsxwing@gmail.com>

Closes #7141 from zsxwing/pr5392-follow-up and squashes the following commits:

fcf7b50 [zsxwing] Remove unnecessary synchronized
  • Loading branch information
zsxwing authored and rxin committed Jul 1, 2015
1 parent b6e76ed commit 64c1461
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -518,12 +518,9 @@ private[master] class Master(
}

private def completeRecovery() {
// TODO Why synchronized
// Ensure "only-once" recovery semantics using a short synchronization period.
synchronized {
if (state != RecoveryState.RECOVERING) { return }
state = RecoveryState.COMPLETING_RECOVERY
}
if (state != RecoveryState.RECOVERING) { return }
state = RecoveryState.COMPLETING_RECOVERY

// Kill off any workers and apps that didn't respond to us.
workers.filter(_.state == WorkerState.UNKNOWN).foreach(removeWorker)
Expand Down

0 comments on commit 64c1461

Please sign in to comment.