You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Kousuke Saruta (Jira)" <ji...@apache.org> on 2021/11/13 15:37:00 UTC

[jira] [Created] (SPARK-37315) Mitigate a ConcurrentModificationException thrown from a test in MLEventSuite

Kousuke Saruta created SPARK-37315:
--------------------------------------

             Summary: Mitigate a ConcurrentModificationException thrown from a test in MLEventSuite
                 Key: SPARK-37315
                 URL: https://issues.apache.org/jira/browse/SPARK-37315
             Project: Spark
          Issue Type: Bug
          Components: ML, Tests
    Affects Versions: 3.3.0
            Reporter: Kousuke Saruta
            Assignee: Kousuke Saruta


Recently, I notice ConcurrentModificationException is thrown from the following part of the test "pipeline read/write events" in MLEventSuite when Scala 2.13 is used.
{code}
events.map(JsonProtocol.sparkEventToJson).foreach { event =>
  assert(JsonProtocol.sparkEventFromJson(event).isInstanceOf[MLEvent])
}
{code}

I think the root cause is the ArrayBuffer (events) is updated asynchronously by the following part.
{code}
private val listener: SparkListener = new SparkListener {
  override def onOtherEvent(event: SparkListenerEvent): Unit = event match {
    case e: MLEvent => events.append(e)
    case _ =>
  }
}
{code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org