Skip to content

Commit 5270209

Browse files
committed
clear sqlListener
1 parent 690277e commit 5270209

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,7 @@ class SQLContext private[sql](
12171217
sparkContext.addSparkListener(new SparkListener {
12181218
override def onApplicationEnd(applicationEnd: SparkListenerApplicationEnd): Unit = {
12191219
SQLContext.clearInstantiatedContext(self)
1220+
SQLContext.clearSqlListener()
12201221
}
12211222
})
12221223

sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLListenerSuite.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ class SQLListenerMemoryLeakSuite extends SparkFunSuite {
343343
.set("spark.sql.ui.retainedExecutions", "50") // Set it to 50 to run this test quickly
344344
val sc = new SparkContext(conf)
345345
try {
346+
SQLContext.clearSqlListener()
346347
val sqlContext = new SQLContext(sc)
347348
import sqlContext.implicits._
348349
// Run 100 successful executions and 100 failed executions.

0 commit comments

Comments
 (0)