Add WithConnectTimeout to bound and retry session establishment - #5
Open
r-jais wants to merge 1 commit into
Open
Add WithConnectTimeout to bound and retry session establishment#5r-jais wants to merge 1 commit into
r-jais wants to merge 1 commit into
Conversation
r-jais
marked this pull request as ready for review
August 6, 2026 07:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
WithConnectTimeout(d time.Duration)connection option and aConfig.ConnectTimeoutfield. When set,connector.Connectbounds the wholeOpenSessionby that deadline and keeps retrying while the failure is transient (e.g. a cold-starting warehouse returning HTTP 503), stopping as soon as the deadline elapses.Why
A non-serverless Databricks cluster that cold-starts can take minutes to accept a session. Today
OpenSessionis a single attempt whose retries are capped by the sharedRetryMax(default 4), so a slow cold start fails well before the cluster is ready and there is no knob to wait longer. See dbt-labs/dbt-core#14529.Behavior
ConnectTimeout <= 0(default): a single attempt — identical to prior behavior. This is a purely additive mechanism; existing callers are unaffected.ConnectTimeout > 0: retryOpenSessionwith exponential backoff (bounded byRetryWaitMin/RetryWaitMax) until success or the deadline. Retries here are independent of the query-levelRetryMax, so query behavior is unchanged.errors.Is(err, RetryableError).Tests
TestWithConnectTimeout(option sets the config; defaults to zero). ExistingTestNewConnectorunaffected.Part of a cross-repo change
databricks.connect_timeoutoption + default, consuming thisconnect_timeoutprofile field throughThe consumer (2) can only bump its go.mod to depend on
WithConnectTimeoutonce this is merged and tagged.