Skip to content

Commit

Permalink
Merge pull request apache#71 from MikhailErofeev/feature/shs-race
Browse files Browse the repository at this point in the history
LAKECOMP-390 Fix race condition for fileToAppInfo field
  • Loading branch information
MikhailErofeev authored Mar 23, 2018
2 parents 4119fed + 9f275a5 commit 0674446
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@

package org.apache.spark.deploy.history

import collection.JavaConverters._
import java.io.{FileNotFoundException, IOException, OutputStream}
import java.util.UUID
import java.util.concurrent.{Executors, ExecutorService, Future, TimeUnit}
import java.util.concurrent.{ConcurrentHashMap, Executors, ExecutorService, Future, TimeUnit}
import java.util.zip.{ZipEntry, ZipOutputStream}

import scala.collection.mutable
Expand Down Expand Up @@ -122,7 +123,7 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
@volatile private var applications: mutable.LinkedHashMap[String, FsApplicationHistoryInfo]
= new mutable.LinkedHashMap()

val fileToAppInfo = new mutable.HashMap[Path, FsApplicationAttemptInfo]()
val fileToAppInfo = new ConcurrentHashMap[Path, FsApplicationAttemptInfo]().asScala

// List of application logs to be deleted by event log cleaner.
private var attemptsToClean = new mutable.ListBuffer[FsApplicationAttemptInfo]
Expand Down

0 comments on commit 0674446

Please sign in to comment.