The kernel owns the retry loop on the SEA/use_kernel path, so forward the
driver's existing ClientConfig retry knobs (the same ones the Thrift
HttpRetryPolicy reads) onto the napi ConnectionOptions retry kwargs — keeping
SEA and Thrift governed by one retry config. Mirrors Python connector #820.
- buildSeaRetryOptions(config): ms -> whole seconds, clamped to napi u32.
retryDelayMin->retryMinWaitSecs, retryDelayMax->retryMaxWaitSecs,
retriesTimeout->retryOverallTimeoutSecs, retryMaxAttempts passes through as a
TOTAL attempt count (the kernel converts to retries-after-first).
- SeaBackend.connect() merges it into the native options from the client config.
- Adds SeaSessionDefaults retry fields + unit tests (mapping, rounding, clamp).
Requires kernel napi retry kwargs (databricks-sql-kernel #141). KERNEL_REV is
pinned to #141's branch HEAD as a placeholder — MUST be re-pinned to #141's
squash-merge SHA before this merges (orphan-SHA risk otherwise).
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
What
The kernel owns the retry loop on the SEA (useSEA/use_kernel) path, so this forwards the driver's existing ClientConfig retry knobs — the same ones the Thrift HttpRetryPolicy reads — onto the napi ConnectionOptions retry kwargs. SEA and Thrift are then governed by one retry config. This is the Node analogue of Python connector #820.
Changes
buildSeaRetryOptions(config) (lib/sea/SeaAuth.ts) — converts the connector's milliseconds → the kernel's whole seconds, clamped into the napi u32 range:
SeaBackend.connect() merges the retry options (read from context.getConfig()) into the native options.
SeaSessionDefaults gains the four optional retry fields; unit tests cover the mapping, sub-second rounding, and the negative/garbage clamp.
retryMaxAttempts passes through directly because Node's policy (attempt >= retryMaxAttempts) already treats it as a total attempt count, matching the kernel semantics. The default knobs (1s/60s/900s) line up with the kernel defaults.
⚠️ Blocked on kernel #141
Depends on the napi retry kwargs added in databricks-sql-kernel #141. KERNEL_REV is pinned to #141's branch HEAD as a placeholder — must be re-pinned to #141's squash-merge SHA before this merges (orphan-SHA risk otherwise). Draft until #141 lands.
This pull request and its description were written by Isaac.