Commit 269174e
Improve error messages for transient HTTP failures during Thrift polling (#1426)
## Summary
Fixes unclear error messages when the cluster is temporarily unavailable
(e.g. HTTP 502 Bad Gateway) during `GetOperationStatus` polling.
Previously, errors showed `error: [null]` with no way for callers to
identify them as transient/retryable.
- **Enrich null error messages**: When the server returns `ERROR_STATUS`
with null `errorMessage`, the driver now includes `errorCode`,
`errorDetailsJson`, and `infoMessages` from `TStatus` instead of showing
`error: [null]`
- **Catch transient HTTP failures**: `TException` from
`GetOperationStatus` in the polling loop (typically from 502/503 after
retry exhaustion) is now caught and wrapped with a descriptive message
explaining this is a transient communication failure
- **Retryable SQL state**: Uses SQL state `08S01` (communication link
failure) so callers can programmatically identify these as retryable
errors
### Before
```
Operation status check failed with status code: [ERROR_STATUS] for statement [46a475dc-...], error: [null]
```
No SQL state, no way to identify as transient.
### After
```
Lost connection to server while polling statement [46a475dc-...]. This is typically a transient error (e.g. HTTP 502 Bad Gateway) indicating the cluster was temporarily unavailable. Cause: Retry failure. HTTP response code: 502, Error Message: Bad Gateway
```
SQL state: `08S01` (communication link failure).
Fixes #1165
## Test plan
- [x] `DatabricksThriftAccessorTest` — 50 tests pass
- [x] Updated `testExecute_setsStatementIdEvenIfStatusRequestFails` to
verify `08S01` SQL state and descriptive message
This pull request was AI-assisted by Isaac.
---------
Signed-off-by: Gopal Lal <gopal.lal@databricks.com>
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
Signed-off-by: Sreekanth Vadigi <sreekanth.vadigi@databricks.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Vikrant Puppala <vikrant.puppala@databricks.com>
Co-authored-by: Sreekanth <sreekanth.vadigi@databricks.com>
Co-authored-by: Samikshya Chand <148681192+samikshya-db@users.noreply.github.com>1 parent b2af201 commit 269174e
6 files changed
Lines changed: 115 additions & 18 deletions
File tree
- src
- main/java/com/databricks/jdbc
- common
- dbclient/impl
- sqlexec
- thrift
- test/java/com/databricks/jdbc/dbclient/impl
- sqlexec
- thrift
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
116 | 119 | | |
117 | 120 | | |
118 | 121 | | |
| |||
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
488 | 489 | | |
489 | 490 | | |
490 | 491 | | |
491 | | - | |
| 492 | + | |
492 | 493 | | |
493 | 494 | | |
494 | | - | |
495 | | - | |
| 495 | + | |
| 496 | + | |
496 | 497 | | |
497 | 498 | | |
498 | 499 | | |
| |||
548 | 549 | | |
549 | 550 | | |
550 | 551 | | |
551 | | - | |
| 552 | + | |
552 | 553 | | |
553 | 554 | | |
554 | | - | |
555 | | - | |
| 555 | + | |
| 556 | + | |
556 | 557 | | |
557 | 558 | | |
558 | 559 | | |
| |||
Lines changed: 64 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
329 | 331 | | |
330 | 332 | | |
331 | 333 | | |
332 | | - | |
333 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
334 | 341 | | |
335 | 342 | | |
336 | 343 | | |
| |||
752 | 759 | | |
753 | 760 | | |
754 | 761 | | |
755 | | - | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
756 | 767 | | |
757 | 768 | | |
758 | 769 | | |
| |||
822 | 833 | | |
823 | 834 | | |
824 | 835 | | |
| 836 | + | |
825 | 837 | | |
826 | 838 | | |
827 | 839 | | |
828 | 840 | | |
829 | | - | |
| 841 | + | |
830 | 842 | | |
831 | 843 | | |
832 | 844 | | |
| |||
838 | 850 | | |
839 | 851 | | |
840 | 852 | | |
| 853 | + | |
841 | 854 | | |
842 | 855 | | |
843 | 856 | | |
844 | | - | |
| 857 | + | |
845 | 858 | | |
846 | 859 | | |
847 | 860 | | |
| |||
855 | 868 | | |
856 | 869 | | |
857 | 870 | | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
858 | 917 | | |
859 | 918 | | |
860 | 919 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1120 | 1120 | | |
1121 | 1121 | | |
1122 | 1122 | | |
1123 | | - | |
1124 | 1123 | | |
1125 | 1124 | | |
1126 | 1125 | | |
| |||
1141 | 1140 | | |
1142 | 1141 | | |
1143 | 1142 | | |
1144 | | - | |
1145 | 1143 | | |
1146 | 1144 | | |
1147 | 1145 | | |
| |||
Lines changed: 40 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
472 | 473 | | |
473 | 474 | | |
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 | + | |
475 | 508 | | |
476 | 509 | | |
477 | 510 | | |
| |||
778 | 811 | | |
779 | 812 | | |
780 | 813 | | |
781 | | - | |
| 814 | + | |
782 | 815 | | |
783 | 816 | | |
784 | 817 | | |
| |||
789 | 822 | | |
790 | 823 | | |
791 | 824 | | |
792 | | - | |
| 825 | + | |
793 | 826 | | |
794 | 827 | | |
795 | 828 | | |
796 | | - | |
797 | | - | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
798 | 834 | | |
799 | 835 | | |
800 | 836 | | |
| |||
0 commit comments