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


##########
sql/connect/client/jdbc/src/main/scala/org/apache/spark/sql/connect/client/jdbc/SparkConnectStatement.scala:
##########
@@ -35,14 +35,21 @@ class SparkConnectStatement(conn: SparkConnectConnection) 
extends Statement {
   override def close(): Unit = synchronized {
     if (!closed) {
       if (operationId != null) {
-        conn.spark.interruptOperation(operationId)
+        try {
+          conn.spark.interruptOperation(operationId)
+        } catch {
+          case _: java.net.ConnectException =>
+            // Ignore ConnectExceptions during cleanup as the operation may 
have already completed
+            // or the server may be unavailable. The important part is marking 
this statement
+            // as closed to prevent further use.

Review Comment:
   @vinodkc I think the reviewer does not reach a consensus to swallow this 
exception, and I tend to agree with @cloud-fan's last comments
   
   https://github.com/apache/spark/pull/53236#issuecomment-3587886559
   
   > If the driver is crashed, it doesn't help to swallow the error when 
closing the statement, as the next test case will still fail.



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