Sitelet https://github.com/databricks/databricks-sql-python/pull/931
Skip to content

feat(kernel): forward socket timeout - #931

Open
vuanhphung wants to merge 3 commits into
mainfrom
vu-phung/forward-kernel-request-timeout
Open

feat(kernel): forward socket timeout#931
vuanhphung wants to merge 3 commits into
mainfrom
vu-phung/forward-kernel-request-timeout

Conversation

@vuanhphung

Copy link
Copy Markdown
Collaborator

Forward the connector's existing _socket_timeout to the kernel's PyO3 request_timeout_secs binding introduced in databricks/databricks-sql-kernel#288. Positive values become total HTTP request deadlines; unset or zero selects the kernel's 120-second default.

The kernel pin is updated to the merged binding commit. Focused kernel client/session tests pass, and the changed files pass Black.


This PR was created with GitHub MCP.

Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good — clean, well-tested forwarding of _socket_timeout to the kernel's request_timeout_secs, with the Thrift path and its 900 default untouched and unset correctly deferring to the kernel's 120s default. One low note: negative values are forwarded unvalidated despite the docs framing the contract around positive/zero values.

# Translate the connector's ``_retry_*`` kwargs into the
# kernel's ``retry_*`` kwargs. Empty when at defaults.
retry_kwargs = _kernel_retry_kwargs(self._retry_options)
request_timeout_kwargs: Dict[str, Any] = {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — Only None is filtered before forwarding — any other value, including negatives, is passed straight through to the kernel's request_timeout_secs. The docs describe the contract as "a positive value is forwarded; unset or 0 selects the kernel's 120s default," which leaves negative values unaddressed. If a caller passes a negative _socket_timeout on the kernel path, it will be forwarded verbatim and the kernel's behavior for a negative deadline is unspecified here. Consider validating/normalizing non-positive values to match the documented contract, or documenting that negatives are passed through and rely on kernel-side handling. Tests parametrize None/0/12.5 but no negative case.

Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant