Skip to content

Kernel backend: route each destination with Go's NO_PROXY rules #611

Backlog

Description

@cathleeny

Summary

On the kernel backend, NO_PROXY from the environment is applied with the kernel's matching rules for every host other than the warehouse, so routing can differ from the Thrift path. The kernel backend should make Go's own routing decision (http.ProxyFromEnvironment) for each destination: the warehouse, CloudFetch storage and OAuth hosts.

Current behavior (since #607)

The driver passes the kernel a single proxy URL plus a bypass list translated from NO_PROXY. The kernel matches that list by host name only: a domain entry also matches its subdomains, and there are no port-specific entries. The warehouse always follows Go's exact decision; other hosts get the closest kernel equivalent:

  • .example.net bypasses only subdomains in Go, but also example.net itself on the kernel path.
  • host:port entries are port-specific in Go. On the kernel path they're kept only for port 443 (storage and OAuth hosts) and dropped otherwise.
  • An entry that would wrongly bypass a proxied warehouse under the kernel's rules is dropped, so another host can lose a bypass the user intended.
  • An http:// warehouse proxied through HTTP_PROXY makes the other hosts (https) use HTTP_PROXY too, where Thrift would use HTTPS_PROXY.

Some of these cases also change routing for plain HTTP(S) proxies, not only SOCKS. CONNECTION_PARAMETERS.md documents them.

What's needed

  • A way for the driver to decide the proxy per destination through the shared kernel transport, for example a per-request proxy resolver in the kernel's C API (databricks/databricks-sql-kernel), failing closed when the driver selects an unsupported proxy.
  • The driver then routes every kernel destination with http.ProxyFromEnvironment. That also makes it possible to reject an env socks4:///socks4a:// proxy only for a destination that actually selects it.
  • The existing proxy test tables should assert the resulting proxy/direct decision for each destination.

Context: #607 (review discussion on kernel_config.go).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions