Repository navigation
[ES-1717770] Fix timeout exception during fetch results - #1199
Merged
samikshya-db merged 4 commits intoFeb 5, 2026
Merged
Conversation
vikrantpuppala
approved these changes
Feb 5, 2026
vikrantpuppala
left a comment
Collaborator
There was a problem hiding this comment.
qq: does this only update DatabricksSQLException -> SQLException in the paths that need to propogate the SQLTimeoutException or everywhere?
Collaborator
Author
|
Thanks for the review, @vikrantpuppala
Yes, the propogation errors had me changing at most places. |
samikshya-db
added a commit
that referenced
this pull request
Mar 16, 2026
…e clusters (#1244) ## Description Follow-up to #1199 ([ES-1717770]). The previous fix covered the case where `FetchResults` returns an error status with `sqlState=57KD0`. However, the interactive cluster path was still broken. **Root cause:** When using interactive clusters with `enableDirectResults=true`, the cluster can enforce its own server-side query timeout and return `TIMEDOUT_STATE` directly in `directResults.operationStatus` — before the client's polling loop ever starts. Because `isErrorOperationState` did not include `TIMEDOUT_STATE`, the driver: 1. Did not throw in `checkOperationStatusForErrors` 2. `shouldContinuePolling(TIMEDOUT_STATE)` returned false → polling loop never started → `TimeoutHandler` never fired 3. Fell through to `executeFetchRequest` → server returned an error → driver threw `DatabricksHttpException` instead of `DatabricksTimeoutException` The same gap also affects the polling path when `GetOperationStatus` returns `TIMEDOUT_STATE` during polling. **Fix:** - Add `TIMEDOUT_STATE` to `isErrorOperationState` - Throw `DatabricksTimeoutException` for `TIMEDOUT_STATE` in `checkOperationStatusForErrors` regardless of whether `sqlState` is set (interactive clusters do not always populate it) ## Testing - `testTimedOutStateInDirectResultsThrowsTimeoutException` — Pavan's exact repro: server returns `TIMEDOUT_STATE` in `directResults` before polling starts - `testTimedOutStateDuringPollingThrowsTimeoutException` — server returns `TIMEDOUT_STATE` during polling ## Additional Notes The original ES-1717770 verification test passed on both warehouse and all-purpose cluster because `setQueryTimeout(1)` with a long-running query caused the server to return `RUNNING_STATE` first (query still in-flight), entering the polling loop where `TimeoutHandler` fired correctly. Pavan's repro consistently hits the other path: the cluster's own timeout fires first, returning `TIMEDOUT_STATE` directly, bypassing the polling loop entirely. [ES-1717770]: https://databricks.atlassian.net/browse/ES-1717770?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Signed-off-by: Samikshya Chand <[email protected]> Signed-off-by: samikshya-chand_data <[email protected]>
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.
Description
Testing
Additional Notes to the Reviewer
SQLException, but the main code change is a small one and is present insrc/main/java/com/databricks/jdbc/common/util/DatabricksThriftUtil.javafileOVERRIDE_FREEZE=true