Skip to content

Capture DatabricksError when retrying API calls #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tom-s-powell
Copy link

@tom-s-powell tom-s-powell commented Apr 4, 2025

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.

@renaudhartert-db renaudhartert-db self-requested a review April 7, 2025 16:18
@tom-s-powell tom-s-powell changed the title Catprue DatabricksError when retrying API calls Capture DatabricksError when retrying API calls Apr 9, 2025
@renaudhartert-db
Copy link
Contributor

Hi @tom-s-powell, thanks for the PR! Before we proceed, could you make sure that all your commits are verified? Unverified commits are not allowed in this repository.

Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-java

Inputs:

  • PR number: 427
  • Commit SHA: a37722faaf6518db5895546ace236782d44d23b3

Checks will be approved automatically on success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants