Skip to content

feat(kernel): wire retry/backoff params + verify metric-view on use_kernel#820

Open
vikrantpuppala wants to merge 1 commit into
mainfrom
feat/use-kernel-retry-config
Open

feat(kernel): wire retry/backoff params + verify metric-view on use_kernel#820
vikrantpuppala wants to merge 1 commit into
mainfrom
feat/use-kernel-retry-config

Conversation

@vikrantpuppala
Copy link
Copy Markdown
Contributor

What

Connector follow-up to kernel PR #117 (configurable retry/backoff + UC Metric View session-conf allowlist). Wires the connector's retry tuning to the kernel path and confirms metric-view metadata works end-to-end. Bumps KERNEL_REV to the merged kernel main.

Retry/backoff

The kernel owns the retry loop on the use_kernel path. This forwards the connector's existing _retry_* kwargs to it:

  • session.py adds a retry_options dict to the kernel client (kernel-only; Thrift/SEA unaffected).

  • client._kernel_retry_kwargs maps them to the kernel Session retry kwargs:

    Connector Kernel Note
    _retry_delay_min retry_min_wait_secs round float→int secs
    _retry_delay_max retry_max_wait_secs round
    _retry_stop_after_attempts_count retry_max_attempts 1:1 total attempts (kernel does the −1)
    _retry_stop_after_attempts_duration retry_overall_timeout_secs round
    _retry_delay_default no kernel equivalent (kernel backoff is exponential from retry_min_wait)

    Connector delays are float seconds; the kernel takes whole seconds. We round, flooring any positive sub-second value to 1s so a configured backoff never collapses to "no wait".

Metric View — no wiring needed

enable_metric_view_metadata=True already injects spark.sql.thriftserver.metadata.metricview.enabled into session_configuration (backend-agnostic, before backend selection), and the kernel client passes session_configurationsession_conf verbatim. Kernel #117 now allowlists that conf (sent verbatim, not uppercased — spark.* confs are case-sensitive), so it reaches the server on use_kernel. Added an e2e test for the round-trip.

Verification

  • Unit: _kernel_retry_kwargs mapping (rounding, sub-second floor, count 1:1, only-set-keys) + retry-options threading through session.py (wheel-independent; verified with import databricks_sql_kernel blocked, reproducing the no-wheel CI).
  • Live e2e (dogfood): retry params accepted end-to-end + metric-view passthrough — both green. Plus session-config + select-one smoke.
  • black + mypy clean.

KERNEL_REVb4d88220cdfad8dba1cfa89892269342ae26feeb.

This pull request and its description were written by Isaac.

…-view passthrough

Consume the kernel's newly-configurable retry policy (kernel PR #117)
from the use_kernel path, and confirm UC Metric View metadata works
end-to-end now that the kernel allowlists its session conf. Bumps
KERNEL_REV to the merged kernel main.

Retry:
- session.py forwards the connector's _retry_* kwargs into the kernel
  client (new retry_options, kernel-only; Thrift/SEA unaffected).
- client._kernel_retry_kwargs maps them to the kernel Session retry
  kwargs: _retry_delay_min -> retry_min_wait_secs, _retry_delay_max ->
  retry_max_wait_secs, _retry_stop_after_attempts_count ->
  retry_max_attempts (1:1 total-attempts; the kernel does the
  retries-after-first conversion), _retry_stop_after_attempts_duration
  -> retry_overall_timeout_secs. Connector delays are float seconds;
  the kernel takes whole seconds, so we round, flooring any positive
  sub-second value to 1s (never collapse a configured backoff to 0).
  _retry_delay_default has no kernel equivalent (the kernel's
  no-Retry-After backoff is exponential from retry_min_wait).

Metric View:
- No connector wiring needed: enable_metric_view_metadata already
  injects spark.sql.thriftserver.metadata.metricview.enabled into
  session_configuration (backend-agnostic), which the kernel client
  passes through to session_conf. Kernel #117 now allowlists that conf
  verbatim, so it reaches the server on the use_kernel path. Added an
  e2e test confirming the round-trip.

KERNEL_REV -> b4d88220cdfad8dba1cfa89892269342ae26feeb (kernel main with
retry config + metric-view allowlist).

Tests: unit tests for _kernel_retry_kwargs (rounding, sub-second floor,
count 1:1, only-set-keys) and retry-options threading through session.py
(wheel-independent, verified with the kernel import blocked); live e2e
(retry params accepted + metric-view passthrough) green against dogfood.
black + mypy clean.

Co-authored-by: Isaac
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants