Skip to content

Commit 64c1461

Browse files
zsxwingrxin
authored andcommitted
[SPARK-6602][Core]Remove unnecessary synchronized
A follow-up pr to address #5392 (comment) Author: zsxwing <[email protected]> Closes #7141 from zsxwing/pr5392-follow-up and squashes the following commits: fcf7b50 [zsxwing] Remove unnecessary synchronized
1 parent b6e76ed commit 64c1461

File tree

1 file changed

+2
-5
lines changed
  • core/src/main/scala/org/apache/spark/deploy/master

1 file changed

+2
-5
lines changed

core/src/main/scala/org/apache/spark/deploy/master/Master.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -518,12 +518,9 @@ private[master] class Master(
518518
}
519519

520520
private def completeRecovery() {
521-
// TODO Why synchronized
522521
// Ensure "only-once" recovery semantics using a short synchronization period.
523-
synchronized {
524-
if (state != RecoveryState.RECOVERING) { return }
525-
state = RecoveryState.COMPLETING_RECOVERY
526-
}
522+
if (state != RecoveryState.RECOVERING) { return }
523+
state = RecoveryState.COMPLETING_RECOVERY
527524

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

0 commit comments

Comments
 (0)