Commit b572b7c
### What changes were proposed in this pull request?
This PR fixes two issues in `org.apache.spark.sql.connect.client.jdbc.SparkConnectStatement.close()`:
- Added `try-catch` to silently handle `ConnectException` during `interruptOperation()` when the server is unavailable
- Fixed bug: changed closed = false to closed = true at the end of the method
### Why are the changes needed?
- ConnectException handling: The `SparkConnectStatement.close()` method should not throw exceptions during cleanup. Connection exceptions during cleanup are not actionable and only mask more important exceptions.
- closed flag bug: Setting closed = false is incorrect and could allow reuse of closed statements.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Existing unit tests pass
### Was this patch authored or co-authored using generative AI tooling?
No
Closes #53260 from vinodkc/br_handle_close_exception.
Authored-by: vinodkc <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit bb36695)
Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent e00cd4e commit b572b7c
File tree
1 file changed
+9
-2
lines changed- sql/connect/client/jdbc/src/main/scala/org/apache/spark/sql/connect/client/jdbc
1 file changed
+9
-2
lines changedLines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
45 | | - | |
| 52 | + | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
| |||
0 commit comments