Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be more specific exception, @vinodkc ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if we can match the exceptions explicitly. For example,

java.net.ConnectException

Copy link
Member

@pan3793 pan3793 Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just use the utility method Utils.closeQuietly?

nvm, this is fine

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just use the utility method Utils.closeQuietly?

+1

// 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, this is an obvious bug.

}
}

Expand Down