Github user kiszk commented on a diff in the pull request: https://github.com/apache/spark/pull/22001#discussion_r208950122 --- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala --- @@ -929,6 +955,28 @@ class DAGScheduler( // HadoopRDD whose underlying HDFS files have been deleted. finalStage = createResultStage(finalRDD, func, partitions, jobId, callSite) } catch { + case e: Exception if e.getMessage == + DAGScheduler.ERROR_MESSAGE_BARRIER_REQUIRE_MORE_SLOTS_THAN_CURRENT_TOTAL_NUMBER => + logWarning("The job requires to run a barrier stage that requires more slots than the " + + "total number of slots in the cluster currently.") + jobIdToNumTasksCheckFailures.putIfAbsent(jobId, 0) + val numCheckFailures = jobIdToNumTasksCheckFailures.get(jobId) + 1 --- End diff -- Is it OK while this increment is not atomic? In the following scenario, the value may not be correct 1. We assume `jobIdToNumTasksCheckFailures(jobId) = 1` 1. Thread A executes L963, then `numCheckFailures = 2` 1. Thread B executes L963, then `numCheckFailures = 2` 1. Thread B executes L964 and L965, then `jobIdToNumTasksCheckFailures(jobId)` has 2. 1. Thread A executes L964 and L965, then `jobIdToNumTasksCheckFailures(jobId)` has 2. Since two threads detected failure, we expect `3`. But, it is `2`.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org