Repository navigation
feat(c-abi): per-call deadline for kernel_session_test (odbc#347-C) - #310
Merged
Merged
Conversation
vikrantpuppala
temporarily deployed
to
azure-prod
September 3, 2026 03:36 — with
GitHub Actions
Inactive
vikrantpuppala
temporarily deployed
to
azure-prod
September 3, 2026 03:36 — with
GitHub Actions
Inactive
vikrantpuppala
temporarily deployed
to
azure-prod
September 3, 2026 03:36 — with
GitHub Actions
Inactive
vikrantpuppala
force-pushed
the
odbc-347c-connection-test-timeout
branch
from
September 3, 2026 04:00
3ec28e1 to
9ccde87
Compare
vikrantpuppala
temporarily deployed
to
azure-prod
September 3, 2026 04:00 — with
GitHub Actions
Inactive
vikrantpuppala
temporarily deployed
to
azure-prod
September 3, 2026 04:00 — with
GitHub Actions
Inactive
vikrantpuppala
temporarily deployed
to
azure-prod
September 3, 2026 04:00 — with
GitHub Actions
Inactive
vikrantpuppala
temporarily deployed
to
azure-prod
September 3, 2026 04:00 — with
GitHub Actions
Inactive
vikrantpuppala
enabled auto-merge
September 3, 2026 04:02
There was a problem hiding this comment.
Verdict: 1 Low
Looks good — a focused, well-tested change. The C ABI signature bump is fully propagated (header, all wiremock callers, docs), ErrorCode::Timeout maps to KernelStatusCode::Timeout, Duration is already in scope, and tokio::time::timeout runs inside block_on_ffi's runtime. One low convention/consistency note on the timeout error construction.
kernel_session_test previously ran its SELECT 1 probe on the session's own retry/timeout budget, so a host backing ConnectionTestTimeout could not enforce the configured duration — ConnectionTestTimeout=1 and =30 behaved identically, and SQL_ATTR_CONNECTION_DEAD could block for the session's unrelated retry budget during an outage. Add a `timeout_secs` parameter (0 = no per-call deadline, the historical behaviour). Session::test_connection_with_timeout wraps the probe in tokio::time::timeout, bounding the whole probe (retries + HTTP included) to the deadline and returning a Timeout-category error when it elapses. The bound is scoped to the probe future, so it cannot alter the timeout of any other request on the session. Wiremock test: a 1s deadline against a 20s response returns Timeout in ~1s, not ~20s. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
vikrantpuppala
force-pushed
the
odbc-347c-connection-test-timeout
branch
from
September 3, 2026 04:09
9ccde87 to
c515ae6
Compare
vikrantpuppala
temporarily deployed
to
azure-prod
September 3, 2026 04:10 — with
GitHub Actions
Inactive
vikrantpuppala
temporarily deployed
to
azure-prod
September 3, 2026 04:10 — with
GitHub Actions
Inactive
vikrantpuppala
temporarily deployed
to
azure-prod
September 3, 2026 04:10 — with
GitHub Actions
Inactive
vikrantpuppala
temporarily deployed
to
azure-prod
September 3, 2026 04:10 — with
GitHub Actions
Inactive
vikrantpuppala
had a problem deploying
to
azure-prod
September 3, 2026 04:10 — with
GitHub Actions
Error
This branch was previously deployed
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.
Summary
Adds a per-call deadline to
kernel_session_testso an ODBC host can actually enforceConnectionTestTimeout(databricks/databricks-odbc#347, defect C).Previously the
SELECT 1connection probe ran on the session's own retry/timeout budget, soConnectionTestTimeout=1and=30behaved identically, andSQL_ATTR_CONNECTION_DEADcould block for the session's unrelated retry budget during an outage.timeout_secsparameter onkernel_session_test(0= no per-call deadline, the historical behaviour).Session::test_connection_with_timeoutwraps the probe intokio::time::timeout, bounding the whole probe (retries + HTTP included) and returning aTimeout-category error when it elapses. The bound is scoped to the probe future, so it never alters the timeout of other requests on the session.include/databricks_kernel.h, hand-written) updated to match.Test plan
session_test_honours_per_call_timeout: a 1s deadline against a 20s response returnsTimeoutin ~1s, not ~20s.session_test_*wiremock tests updated to passtimeout_secs = 0(unchanged behaviour).cargo test --lib session,cargo fmt,cargo clippy --lib --testsclean.Downstream
The ODBC driver's defect-C fix (databricks/databricks-odbc#347) consumes this: it passes the configured
ConnectionTestTimeoutastimeout_secs. The ODBCKERNEL_REPO_TAGmust be bumped to this PR's merge commit.This pull request and its description were written by Isaac.