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


##########
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:
   > I'm a little confused, I believe the author means: UI almost works even if 
appStatusListener is disabled.
   > 
   > If so, separate configs make sense.
   
   Yes that's true, the UI is still available without the listener.



-- 
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