Skip to content

Add Support for Asynchronous Token Refresh via Config #464

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

Closed
wants to merge 58 commits into from

Conversation

emmyzhou-db
Copy link
Contributor

@emmyzhou-db emmyzhou-db commented Jun 17, 2025

What changes are proposed in this pull request?

This PR introduces a new environment variable DATABRICKS_ASYNC_TOKEN_REFRESH to enable asynchronous token refresh in the Databricks SDK for Java. This feature improves performance by allowing token refresh operations to happen in the background, reducing latency for API calls.

This change activates the asynchronous refresh capability that was previously added in #455. When enabled, stale tokens will trigger a background refresh while expired tokens will still block until a new token is fetched.

Note: Async token refresh for direct-to-dataplane access will be added in a separate PR.

How to Enable Async Token Refresh

You can enable async token refresh in two ways:

  1. Set the environment variable:
export DATABRICKS_ASYNC_TOKEN_REFRESH=true
  1. Use the setter in your code:
config.setEnableExperimentalAsyncTokenRefresh(true);

This setting will be automatically picked up by the SDK and applied to all token refresh operations.

How is this tested?

N/A

NO_CHANGELOG=true

@emmyzhou-db emmyzhou-db changed the title Emmyzhou db/enable async refresh Add Support for Asynchronous Token Refresh Jun 17, 2025
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: 464
  • Commit SHA: 37bbe33daa020d2c8a8e0a64d4bf9c23ed4c94d3

Checks will be approved automatically on success.

@emmyzhou-db emmyzhou-db changed the base branch from main to emmyzhou-db/async_token_cache June 17, 2025 15:35
Base automatically changed from emmyzhou-db/async_token_cache to main June 17, 2025 16:27
@emmyzhou-db emmyzhou-db changed the title Add Support for Asynchronous Token Refresh Add Support for Asynchronous Token Refresh via Config Jun 17, 2025
deco-sdk-tagging bot added a commit that referenced this pull request Jun 18, 2025
## Release v0.54.0

### New Features and Improvements
* [Experimental] Add support for asynchronous token refresh ([#464](#465)).
  Enable this feature by setting the environment variable:
  ```bash
  export DATABRICKS_ENABLE_EXPERIMENTAL_ASYNC_TOKEN_REFRESH=true
  ```
  Note: This feature and its configuration are experimental and may be removed in future releases.
@emmyzhou-db emmyzhou-db deleted the emmyzhou-db/enable-async-refresh branch June 26, 2025 13:39
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.

2 participants