Github user mridulm commented on a diff in the pull request:

    https://github.com/apache/spark/pull/228#discussion_r10948883
  
    --- Diff: core/src/main/scala/org/apache/spark/Accumulators.scala ---
    @@ -237,12 +240,7 @@ private object Accumulators {
       // TODO: Use soft references? => need to make readObject work properly 
then
       val originals = Map[Long, Accumulable[_, _]]()
       val localAccums = Map[Thread, Map[Long, Accumulable[_, _]]]()
    -  var lastId: Long = 0
    -
    -  def newId: Long = synchronized {
    -    lastId += 1
    -    lastId
    -  }
    +  var nextAccumID = new AtomicLong(0)
    --- End diff --
    
    ```
    private val nextAccumID = new AtomicLong(0)
    def newId(): Long = nextAccumID.getAndIncrement()
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to