dongjoon-hyun commented on code in PR #53260:
URL: https://github.com/apache/spark/pull/53260#discussion_r2577793257


##########
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:
   BTW, to be clear, as I mentioned in the above, I believe `closed = true` fix 
is very important for `JDBC` module implementation, but I don't consider new 
`JDBC` module itself as a blocker for Apache Spark 4.1.0. This JDBC module 
itself is new and still experimental in 4.1.0. Generally, we stabilize new 
module via multiple subsequent feature and maintenance releases, @pan3793 .



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