Commit 14e4c63
Capture DatabricksError when retrying API calls (#427)
## What changes are proposed in this pull request?
When requests are retried, there is currently no information available
to the caller to understand why. On retries no exception is logged and
on final retry, the cause is only available if an `IOException` were the
original source of failure rather. `DatabricksError` feels like a more
useful error to surface as this will capture the error from the server
which would have evaluated into a retriable error.
Currently the stacktrace appears as follows, which doesn't provide much
information:
```
com.databricks.sdk.core.DatabricksException: Request GET /api/2.1/unity-catalog/tables?catalog_name=<REDACTED>&schema_name=<REDACTED> failed after 4 retries
\tat com.databricks.sdk.core.ApiClient.executeInner(ApiClient.java:282)
\tat com.databricks.sdk.core.ApiClient.getResponse(ApiClient.java:235)
\tat com.databricks.sdk.core.ApiClient.execute(ApiClient.java:227)
\tat com.databricks.sdk.core.ApiClient.GET(ApiClient.java:148)
\tat com.databricks.sdk.service.catalog.TablesImpl.list(TablesImpl.java:47)
\tat com.databricks.sdk.support.Paginator.flipNextPage(Paginator.java:58)
\tat com.databricks.sdk.support.Paginator.<init>(Paginator.java:51)
\tat com.databricks.sdk.service.catalog.TablesAPI.list(TablesAPI.java:102)
\tat com.databricks.sdk.service.catalog.TablesAPI.list(TablesAPI.java:89)
```
## How is this tested?
Unit tests added.
Signed-off-by: Thomas Powell <tpowell@palantir.com>
Co-authored-by: Thomas Powell <tpowell@palantir.com>
Co-authored-by: Renaud Hartert <renaud.hartert@databricks.com>1 parent efe5aa4 commit 14e4c63
File tree
3 files changed
+23
-13
lines changed- databricks-sdk-java/src
- main/java/com/databricks/sdk/core
- test/java/com/databricks/sdk/core
3 files changed
+23
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
| 256 | + | |
256 | 257 | | |
257 | 258 | | |
258 | 259 | | |
| |||
Lines changed: 19 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
91 | | - | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| 99 | + | |
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
| |||
217 | 220 | | |
218 | 221 | | |
219 | 222 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
230 | 238 | | |
231 | 239 | | |
232 | 240 | | |
| |||
0 commit comments