Commit 75d13a2
authored
Fix cancel error handling: vendor code, telemetry level, SEA async path (#1425)
## Summary
Follow-up to #1291 addressing review feedback:
- **F2**: `getErrorCode()` now returns
`DatabricksDriverErrorCode.EXECUTE_STATEMENT_CANCELLED.ordinal()`
instead of 0. The 3-arg `DatabricksSQLException` constructor was
silently discarding the error code.
- **F3**: Cancellation exceptions use `silentExceptions=true` so BI-tool
cancellations (Tableau, Looker) don't emit ERROR-level telemetry.
Cancellations are logged at TRACE level instead.
- **F4**: SEA `getStatementResult()` now detects CANCELED state and
throws `HY008` — previously the async cancel path returned a
`DatabricksResultSet` wrapping null result data.
- **F5**: Added polling-path test (RUNNING → CANCELED during
`pollTillOperationFinished`) for Thrift, which had zero coverage.
## Test plan
- [x]
`DatabricksSdkClientTest#testHandleFailedExecution_CancelledState_ThrowsWithHY008`
— asserts HY008, message, and error code
- [x]
`DatabricksSdkClientTest#testHandleFailedExecution_FailedState_ThrowsWithoutHY008`
— unchanged
- [x]
`DatabricksSdkClientTest#testGetStatementResult_CancelledState_ThrowsWithHY008`
— **new** (F4)
- [x]
`DatabricksThriftAccessorTest#testGetStatementResult_cancelled_throwsWithHY008`
— now asserts error code
- [x]
`DatabricksThriftAccessorTest#testPollingPath_cancelledDuringExecution_throwsWithHY008`
— **new** (F5)
NO_CHANGELOG=true
This pull request was AI-assisted by Isaac.
---------
Signed-off-by: Gopal Lal <gopal.lal@databricks.com>1 parent 269174e commit 75d13a2
6 files changed
Lines changed: 154 additions & 49 deletions
File tree
- src
- main/java/com/databricks/jdbc
- dbclient/impl
- sqlexec
- thrift
- exception
- model/telemetry/enums
- test/java/com/databricks/jdbc/dbclient/impl
- sqlexec
- thrift
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
430 | 443 | | |
431 | 444 | | |
432 | 445 | | |
| |||
726 | 739 | | |
727 | 740 | | |
728 | 741 | | |
729 | | - | |
| 742 | + | |
| 743 | + | |
730 | 744 | | |
731 | 745 | | |
732 | 746 | | |
733 | 747 | | |
734 | 748 | | |
735 | 749 | | |
736 | | - | |
| 750 | + | |
| 751 | + | |
737 | 752 | | |
738 | 753 | | |
739 | 754 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
934 | 934 | | |
935 | 935 | | |
936 | 936 | | |
| 937 | + | |
| 938 | + | |
937 | 939 | | |
938 | | - | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
939 | 944 | | |
940 | 945 | | |
941 | 946 | | |
| |||
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
56 | 64 | | |
57 | 65 | | |
58 | 66 | | |
| |||
Lines changed: 54 additions & 44 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
48 | 58 | | |
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
315 | 316 | | |
316 | 317 | | |
317 | 318 | | |
| |||
338 | 339 | | |
339 | 340 | | |
340 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
341 | 370 | | |
342 | 371 | | |
343 | 372 | | |
| |||
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
474 | 512 | | |
475 | 513 | | |
476 | 514 | | |
| |||
0 commit comments