Skip to content

fix(kernel): point WithTransport rejection to the WithKernel* options - #617

Draft
cathleeny wants to merge 1 commit into
mainfrom
cathleeny/ddf-custom-http-client-go
Draft

cathleeny wants to merge 1 commit into
mainfrom
cathleeny/ddf-custom-http-client-go

Conversation

@cathleeny

@cathleeny cathleeny commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A custom WithTransport can't be used on the kernel backend: a Go RoundTripper can't reach the kernel's
Rust HTTP stack, so the driver rejects it with ErrNotSupportedByKernel. The error told users to "use the default
(Thrift) backend", which is wrong for Reyden warehouses: they reject Thrift, and the default backend then falls
back to the kernel and hits the same error. The message now points to the WithKernel* TLS and proxy options, and
suggests Thrift only for warehouses that accept it.

What changes

  • New error text for WithTransport on the kernel path. The rejection itself, and
    errors.Is(err, ErrNotSupportedByKernel), are unchanged.
  • CONNECTION_PARAMETERS.md: one sentence saying WithTransport can't be used with Reyden warehouses.
  • New TestReydenWithTransportRejection for both Reyden fallback paths: Thrift rejected during connect, and a
    warehouse already known to be Reyden.

Known limit: the kernel path still can't honor a custom transport. Use WithKernelTrustedCerts,
WithKernelClientCertificate, WithKernelProxy or WithKernelSkipHostnameVerify instead.

Testing

Live, against a DBSQL and a Reyden warehouse:

Case DBSQL Reyden
Kernel, SELECT 1, no transport ✅ ✅
Kernel + WithTransport: rejected before any network call, transport never called ✅ ✅
Default backend + counting transport: query passes through the transport (6 requests) ✅ n/a
Default backend + failing transport: connect fails ✅ n/a
Default backend + WithTransport: new message, matches ErrNotSupportedByKernel and ErrReydenThriftUnsupported n/a ✅
Default backend, no transport: falls back to the kernel and passes n/a ✅

Unit: go test passes in the default build and with -tags databricks_kernel; go vet, golangci-lint and gofmt
are clean. The kernel-tagged runs used a kernel archive built from source at KERNEL_REV.

Not run: Windows and macOS builds (CI).

Dependencies

None.

This pull request and its description were written by Isaac.

On the kernel backend a custom WithTransport is rejected with
ErrNotSupportedByKernel. The fix-it text said "use the default (Thrift)
backend", which is wrong after Reyden auto-recovery: Reyden warehouses
reject Thrift (KP001). The message now points to the WithKernel* TLS and
proxy options and qualifies the Thrift suggestion to warehouses that
accept Thrift.

Add hermetic tests for both recovery paths (KP001 recovery and the cached
Reyden pre-check) that assert the sentinels, the message, and that the
caller's transport is never called. Document the Reyden limitation in
CONNECTION_PARAMETERS.md.

Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com>
Co-authored-by: Isaac <no-reply@databricks.com>

This branch has not been deployed

No deployments
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