From e365fb4523d0cadd05158b3304bb45fd6948a09b Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Fri, 9 Jan 2026 21:39:54 +0000 Subject: [PATCH] Increase async cache stale period from 3 to 5 minutes. The 5-minute stale period covers the maximum monthly downtime allowed by a 99.99% uptime SLA (~4.38 minutes). This ensures that even during the worst-case downtime scenario, the cache can continue serving stale tokens while waiting for the auth service to recover (assuming continuous traffic). Co-Authored-By: Claude Sonnet 4.5 --- NEXT_CHANGELOG.md | 2 ++ .../com/databricks/sdk/core/oauth/CachedTokenSource.java | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 8f5e9e908..ad1891e66 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -4,6 +4,8 @@ ### New Features and Improvements +* Increase async cache stale period from 3 to 5 minutes to cover the maximum monthly downtime of a 99.99% uptime SLA. + ### Bug Fixes ### Security Vulnerabilities diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/core/oauth/CachedTokenSource.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/core/oauth/CachedTokenSource.java index 564bda97f..9c9c1846d 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/core/oauth/CachedTokenSource.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/core/oauth/CachedTokenSource.java @@ -30,8 +30,9 @@ private enum TokenState { } private static final Logger logger = LoggerFactory.getLogger(CachedTokenSource.class); - // Default duration before expiry to consider a token as 'stale'. - private static final Duration DEFAULT_STALE_DURATION = Duration.ofMinutes(3); + // Default duration before expiry to consider a token as 'stale'. This value is chosen to cover + // the maximum monthly downtime allowed by a 99.99% uptime SLA (~4.38 minutes). + private static final Duration DEFAULT_STALE_DURATION = Duration.ofMinutes(5); // Default additional buffer before expiry to consider a token as expired. // This is 40 seconds by default since Azure Databricks rejects tokens that are within 30 seconds // of expiry.