Commit c3ae658
Fix is_disconnect to handle closed connection errors
Enhanced is_disconnect() to catch databricks.sql.exc.Error (base class)
and detect "closed connection" errors. This fixes pool_pre_ping failing
when attempting to ping a closed connection.
The default do_ping() tries to create a cursor, which raises Error with
message "Cannot create cursor from closed connection" on closed connections.
Now properly detects this as a disconnect error.
Fixes:
- test_pool_pre_ping_with_closed_connection
- test_is_disconnect_handles_runtime_errors
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 1e47cb2 commit c3ae658
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
| 360 | + | |
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
371 | 380 | | |
372 | 381 | | |
373 | 382 | | |
| |||
0 commit comments