Skip to content

Commit

Permalink
Remove unnecessary synchronized
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxwing committed Jul 1, 2015
1 parent 3bee0f1 commit fcf7b50
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 fcf7b50

Please sign in to comment.