You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2020/12/13 22:54:58 UTC

[spark] branch master updated: [SPARK-33589][SQL][FOLLOWUP] Replace Throwable with NonFatal

This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 94bc2d6  [SPARK-33589][SQL][FOLLOWUP] Replace Throwable with NonFatal
94bc2d6 is described below

commit 94bc2d61a2598d995df8eb79fe450b0e5f6d7582
Author: Yuming Wang <yu...@ebay.com>
AuthorDate: Sun Dec 13 14:52:26 2020 -0800

    [SPARK-33589][SQL][FOLLOWUP] Replace Throwable with NonFatal
    
    ### What changes were proposed in this pull request?
    
    This pr replace `Throwable` with `NonFatal`.
    
    ### Why are the changes needed?
    
    Improve code.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    N/A
    
    Closes #30744 from wangyum/SPARK-33589-2.
    
    Authored-by: Yuming Wang <yu...@ebay.com>
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
 .../spark/sql/hive/thriftserver/SparkSQLSessionManager.scala      | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala
index 0c092ab..89aaa31 100644
--- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala
+++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala
@@ -17,6 +17,8 @@
 
 package org.apache.spark.sql.hive.thriftserver
 
+import scala.util.control.NonFatal
+
 import org.apache.hadoop.hive.conf.HiveConf
 import org.apache.hive.service.cli.{HiveSQLException, SessionHandle}
 import org.apache.hive.service.cli.session.SessionManager
@@ -73,12 +75,12 @@ private[hive] class SparkSQLSessionManager(hiveServer: HiveServer2, sqlContext:
       sparkSqlOperationManager.sessionToContexts.put(sessionHandle, ctx)
       sessionHandle
     } catch {
-      case e: Exception =>
+      case NonFatal(e) =>
         try {
           closeSession(sessionHandle)
         } catch {
-          case t: Throwable =>
-            logWarning("Error closing session", t)
+          case NonFatal(inner) =>
+            logWarning("Error closing session", inner)
         }
         throw new HiveSQLException("Failed to open new session: " + e, e)
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org