[ https://issues.apache.org/jira/browse/SPARK-34934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Apache Spark reassigned SPARK-34934: ------------------------------------ Assignee: Apache Spark > Race condition while registering source in MetricsSystem > --------------------------------------------------------- > > Key: SPARK-34934 > URL: https://issues.apache.org/jira/browse/SPARK-34934 > Project: Spark > Issue Type: Bug > Components: Spark Core > Affects Versions: 2.3.2, 3.1.1 > Reporter: Harsh Panchal > Assignee: Apache Spark > Priority: Minor > > {{MetricsSystem}} manages {{mutable.ArrayBuffer}} of metric sources. > {{registerSource}} and {{removeSource}} methods are provided to add/remove > new source from Metric system. Both these methods are not synchronised. Also, > underlying {{mutable.ArrayBuffer}} not being thread safe, unexpected > behaviours are possible if called concurrently (in our case, multiple > executors registering custom source). > For ex, we got below exception due to race condition > {noformat} > java.lang.ArrayIndexOutOfBoundsException > at > scala.collection.mutable.ResizableArray$class.ensureSize(ResizableArray.scala:104) > at scala.collection.mutable.ArrayBuffer.ensureSize(ArrayBuffer.scala:48) > at scala.collection.mutable.ArrayBuffer.$plus$eq(ArrayBuffer.scala:84) > at > org.apache.spark.metrics.MetricsSystem.registerSource(MetricsSystem.scala:157) > {noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org