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

gurwls223 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 8711c1a6ad9 [SPARK-42945][CONNECT][FOLLOW-UP] Add user_id and 
session_id when logging errors
8711c1a6ad9 is described below

commit 8711c1a6ad99df101b889ffa51260da6cc3ce8f4
Author: allisonwang-db <allison.w...@databricks.com>
AuthorDate: Tue May 2 20:12:25 2023 +0900

    [SPARK-42945][CONNECT][FOLLOW-UP] Add user_id and session_id when logging 
errors
    
    ### What changes were proposed in this pull request?
    
    This is a follow-up PR for SPARK-42945 to include `user_id` and 
`session_id` when logging errors on the Spark Connect server side. It is to 
address [this 
comment](https://github.com/apache/spark/pull/40575#discussion_r1150223876).
    
    ### Why are the changes needed?
    
    To improve debuggability.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No
    
    ### How was this patch tested?
    
    Existing tests.
    
    Closes #41014 from allisonwang-db/spark-42945-follow-up.
    
    Authored-by: allisonwang-db <allison.w...@databricks.com>
    Signed-off-by: Hyukjin Kwon <gurwls...@apache.org>
---
 .../org/apache/spark/sql/connect/service/SparkConnectService.scala  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectService.scala
 
b/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectService.scala
index e8e1b6177a8..0076e54a319 100644
--- 
a/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectService.scala
+++ 
b/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectService.scala
@@ -129,18 +129,18 @@ class SparkConnectService(debug: Boolean)
 
     {
       case se: SparkException if isPythonExecutionException(se) =>
-        logError(s"Error during: $opType", se)
+        logError(s"Error during: $opType. UserId: $userId. SessionId: 
$sessionId.", se)
         observer.onError(
           StatusProto.toStatusRuntimeException(
             buildStatusFromThrowable(se.getCause, stackTraceEnabled)))
 
       case e: Throwable if e.isInstanceOf[SparkThrowable] || NonFatal.apply(e) 
=>
-        logError(s"Error during: $opType", e)
+        logError(s"Error during: $opType. UserId: $userId. SessionId: 
$sessionId.", e)
         observer.onError(
           StatusProto.toStatusRuntimeException(buildStatusFromThrowable(e, 
stackTraceEnabled)))
 
       case e: Throwable =>
-        logError(s"Error during: $opType", e)
+        logError(s"Error during: $opType. UserId: $userId. SessionId: 
$sessionId.", e)
         observer.onError(
           Status.UNKNOWN
             .withCause(e)


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

Reply via email to