pan3793 commented on code in PR #54133:
URL: https://github.com/apache/spark/pull/54133#discussion_r2851217570


##########
sql/core/src/main/scala/org/apache/spark/sql/internal/SharedState.scala:
##########
@@ -120,11 +120,17 @@ private[sql] class SharedState(
    */
   val statusStore: SQLAppStatusStore = {
     val kvStore = 
sparkContext.statusStore.store.asInstanceOf[ElementTrackingStore]
-    val listener = new SQLAppStatusListener(conf, kvStore, live = true)
-    sparkContext.listenerBus.addToStatusQueue(listener)
-    val statusStore = new SQLAppStatusStore(kvStore, Some(listener))
-    sparkContext.ui.foreach(new SQLTab(statusStore, _))
-    statusStore
+    // Only create SQLAppStatusListener when explicitly enabled to avoid 
memory overhead
+    if (conf.get(SQL_UI_APP_STATUS_LISTENER_ENABLED)) {
+      val listener = new SQLAppStatusListener(conf, kvStore, live = true)
+      sparkContext.listenerBus.addToStatusQueue(listener)
+      val statusStore = new SQLAppStatusStore(kvStore, Some(listener))
+      sparkContext.ui.foreach(new SQLTab(statusStore, _))
+      statusStore
+    } else {
+      // When disabled, create a minimal status store without listener
+      new SQLAppStatusStore(kvStore, None)
+    }

Review Comment:
   the impacts looks fine! (you may need to rebase your branch to the latest 
master to solve the Python failures)
   
   So how about
   1. mark the new config `spark.sql.ui.appStatusListener.enabled` as 
`internal` for advanced users, as it has side effects.
   2. keep the default value fallback to `spark.ui.enabled`, then disabling UI 
also reduces driver memory usage.
   
   @mridulm @cloud-fan, WDYT? Does disabling `appStatusListener` have other 
potential impacts other than UI?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to