You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (Jira)" <ji...@apache.org> on 2020/04/11 15:29:00 UTC
[jira] [Resolved] (SPARK-31422) Fix NPE when BlockManagerSource is
used after BlockManagerMaster stops
[ https://issues.apache.org/jira/browse/SPARK-31422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dongjoon Hyun resolved SPARK-31422.
-----------------------------------
Fix Version/s: 3.0.0
2.4.6
Resolution: Fixed
Issue resolved by pull request 28187
[https://github.com/apache/spark/pull/28187]
> Fix NPE when BlockManagerSource is used after BlockManagerMaster stops
> ----------------------------------------------------------------------
>
> Key: SPARK-31422
> URL: https://issues.apache.org/jira/browse/SPARK-31422
> Project: Spark
> Issue Type: Bug
> Components: Spark Core
> Affects Versions: 2.3.4, 2.4.5, 3.0.0
> Reporter: Dongjoon Hyun
> Assignee: Dongjoon Hyun
> Priority: Major
> Fix For: 2.4.6, 3.0.0
>
>
> In `SparkEnv.stop`, the following stop sequence is used.
> {code}
> blockManager.stop()
> blockManager.master.stop()
> metricsSystem.stop()
> {code}
> During `metricsSystem.stop`, some sink can invoke `BlockManagerSource` and ends up with NPE.
> {code}
> sinks.foreach(_.stop)
> registry.removeMatching((_: String, _: Metric) => true)
> {code}
> {code}
> java.lang.NullPointerException
> at org.apache.spark.storage.BlockManagerMaster.getStorageStatus(BlockManagerMaster.scala:170)
> at org.apache.spark.storage.BlockManagerSource$$anonfun$10.apply(BlockManagerSource.scala:63)
> at org.apache.spark.storage.BlockManagerSource$$anonfun$10.apply(BlockManagerSource.scala:63)
> at org.apache.spark.storage.BlockManagerSource$$anon$1.getValue(BlockManagerSource.scala:31)
> at org.apache.spark.storage.BlockManagerSource$$anon$1.getValue(BlockManagerSource.scala:30)
> {code}
> Since SparkContext registers and forgets `BlockManagerSource` without deregistering, we had better avoid NPE inside `BlockManagerMaster`.
> {code}
> _env.metricsSystem.registerSource(new BlockManagerSource(_env.blockManager))
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org