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

    https://github.com/apache/spark/pull/4021#discussion_r25209770
  
    --- Diff: core/src/main/scala/org/apache/spark/Accumulators.scala ---
    @@ -320,7 +334,13 @@ private[spark] object Accumulators {
       def add(values: Map[Long, Any]): Unit = synchronized {
         for ((id, value) <- values) {
           if (originals.contains(id)) {
    -        originals(id).asInstanceOf[Accumulable[Any, Any]] ++= value
    +        // Since we are now storing weak references, we must check whether 
the underlying data
    +        // is valid. 
    +        originals(id).get match {
    +          case Some(accum) => accum.asInstanceOf[Accumulable[Any, Any]] 
++= value
    +          case None => 
    +            throw new IllegalAccessError("Attempted to access garbage 
collected Accumulator.")   
    --- End diff --
    
    If Accumulator is garbage collected, should we log and continue ?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to