cloud-fan commented on code in PR #53260:
URL: https://github.com/apache/spark/pull/53260#discussion_r2578034668
##########
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:
It doesn't hurt to swallow the error when doing a close. I'm fine with this
change. But I don't think this can fix the test flakiness. We need to
investigate more.
--
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]