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


##########
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 _: Exception =>
+            // Ignore exceptions 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.
+        }
         operationId = null
       }
       if (resultSet != null) {
         resultSet.close()
         resultSet = null
       }
-      closed = false
+      closed = true

Review Comment:
   oops, this is an obvious bug.



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