Copilot commented on code in PR #2012:
URL: https://github.com/apache/auron/pull/2012#discussion_r2852309097


##########
auron-spark-ui/src/main/scala/org/apache/spark/sql/execution/ui/AuronSQLAppStatusStore.scala:
##########
@@ -16,14 +16,22 @@
  */
 package org.apache.spark.sql.execution.ui
 
+import scala.util.control.NonFatal
+
 import com.fasterxml.jackson.annotation.JsonIgnore
 import org.apache.spark.util.kvstore.{KVIndex, KVStore}
 
 class AuronSQLAppStatusStore(store: KVStore) {
 
-  def buildInfo(): AuronBuildInfoUIData = {
+  def buildInfo(): Option[AuronBuildInfoUIData] = {
     val kClass = classOf[AuronBuildInfoUIData]
-    store.read(kClass, kClass.getName)
+    // KVStore throws when the record doesn't exist; treat missing data as "no 
build info".
+    try {
+      Option(store.read(kClass, kClass.getName))
+    } catch {
+      case _: NoSuchElementException => None
+      case NonFatal(_) => None

Review Comment:
   The NonFatal exception is being silently swallowed without logging. This 
makes debugging difficult if unexpected errors occur when reading from the 
KVStore. Consider logging the exception at a warning or debug level to help 
diagnose issues. For example: `case NonFatal(e) => logWarning(s"Failed to read 
BuildInfo from KVStore", e); None`
   
   Note that this would require AuronSQLAppStatusStore to extend the Logging 
trait.



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

Reply via email to