Repository navigation
Conversation
c0692fb to
4b8bb28
Compare
4b8bb28 to
d00ce35
Compare
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 High · 1 Low
Mostly solid: 1 medium, 1 low. The env rewrite and rejection logic are correct and well tested. The main concern is that the docs claim SOCKS support while the pinned kernel bindings may not ship it yet.
d00ce35 to
87d2133
Compare
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 High
Needs a kernel pin before merging: 1 high concern. The driver-side env mapping (socks5→socks5h, failing closed on socks4/4a, keeping credentials out of errors) is correct and well tested. The SOCKS support it documents depends on a kernel release this PR doesn't pin.
aakash-saravanan-db
left a comment
There was a problem hiding this comment.
Thanks for the PR! Normalizing environment socks5 to socks5h preserves Go's proxy-side DNS behavior, and the scheme-only error keeps credentials out of diagnostics. The isolated environment tests are useful for avoiding the standard library's cached environment state.
The main change needed is to preserve that policy for every request destination, including CloudFetch storage and OAuth hosts. I've also left a small test-necessity comment and followed up on the existing source-pin discussion; the published bindings update remains separate release work.
Please also shorten the PR description to the public behavior, dependencies, and relevant validation, removing internal tracking details and prior-review history.
This review was generated with GitHub MCP.
87d2133 to
46e6e6b
Compare
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 High · 1 Low
Looks good, with 1 low concern. The SOCKS rewrite and rejection, the NO_PROXY translation and the warehouse parity with Go are correct and well tested, including real-environment tests in a child process. The CHANGELOG entry understates how far the NO_PROXY handling changed.
This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.
Other findings
- 🟠 High — The rewritten SOCKS URL still reaches the native setter, but the pinned kernel rejects SOCKS as acknowledged in the PR description, leaving the advertised feature unusable with the default dependency configuration. Update both the released bindings and source-build pin before merging, and add a tagged SOCKS setter test against those dependencies. (Found by GPT-6.1 Sol · the judge couldn't confirm it)
46e6e6b to
fd2ead6
Compare
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 High · 1 Low
The proxy translation logic looks correct, with one medium concern: the changelog announces SOCKS support before the linked kernel can use it. The kernel.Config proxy doc in internal/backend/kernel/config.go (outside the diff) still says the env path leaves ProxyBypassHosts empty, which this PR makes untrue (nit).
This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.
|
On the review's other finding (High, kernel pin), which the bot's judge couldn't confirm: not changing this here. It's the merge prerequisite already discussed in the resolved KERNEL_REV thread and listed under Dependencies. |
fd2ead6 to
2747d8d
Compare
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 High · 1 Low
Looks good, with 1 low concern. The NO_PROXY translation matches httpproxy's rules, the SOCKS scheme mapping fails closed without leaking the URL, and tests cover the branches. Nits: the WithKernelProxy doc still says "basic-auth credentials" only, and the env fallback assertion in TestResolveKernelProxy is now weak (exact cases live in the child-process test).
This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.
Other findings
- 🟠 High — The new SOCKS translation still reaches a kernel that rejects SOCKS URLs: the shipped bindings remain v1.5.0 and KERNEL_REV remains 3b691d2, as acknowledged in the description, so the advertised feature cannot work for consumers of this PR. Update the published bindings pins and KERNEL_REV before merging, and add a SOCKS case to the real applyProxy setter test so this dependency gap fails validation. (Found by GPT-6.1 Sol · the judge couldn't confirm it)
2747d8d to
311641d
Compare
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 High · 1 Low
Looks good, with 1 low concern. I checked the SOCKS rewrite, the NO_PROXY translation and the error propagation from resolveKernelProxy, and they look correct and well tested. The Reyden fallback path doesn't call resolveKernelProxy, but that was already true before this PR.
This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.
Other findings
- 🟠 High — The new SOCKS URL still reaches a native proxy setter without the required kernel dependency update: the PR acknowledges that pinned revision 3b691d2 rejects SOCKS, and the published bindings remain unchanged, so normal pinned builds cannot deliver this feature. Update KERNEL_REV and the released bindings together before merging, and add a tagged SOCKS case exercising the real applyProxy setter. (Found by GPT-6.1 Sol · the judge couldn't confirm it)
|
On the latest review's High (pinned kernel and bindings), which the bot's judge couldn't confirm: it's the merge prerequisite already answered in the resolved |
…ckend With a kernel that supports SOCKS, keep the Thrift path's behavior for an environment-derived SOCKS proxy on the kernel path. net/http resolves socks5:// targets at the proxy, so an HTTPS_PROXY socks5:// URL is sent to the kernel as socks5h://. net/http cannot use socks4/socks4a, so when the warehouse selects one the connection fails with ErrInvalidKernelConfig; the error names the scheme, not the URL. When NO_PROXY bypasses the warehouse, a socks4/socks4a URL is passed as is, since no request may need it. WithKernelProxy URLs are still passed verbatim with kernel semantics. The environment proxy now applies to every kernel destination: the driver passes it with NO_PROXY translated into the kernel's bypass list, so CloudFetch storage and OAuth hosts in NO_PROXY connect directly. When NO_PROXY bypasses the warehouse, the proxy is still passed with the warehouse added to the bypass list, instead of leaving the kernel to read the raw environment. The warehouse always follows Go's NO_PROXY rules, and the environment is read once per process, as on the Thrift path. Document the kernel-path SOCKS and NO_PROXY behavior, including ALL_PROXY, which the kernel reads itself when no HTTP(S)_PROXY applies. Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com> Co-authored-by: Isaac <no-reply@databricks.com>
311641d to
b851e2e
Compare
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 High
Mostly solid, with 1 medium concern: the docs claim SOCKS support that the pinned kernel bindings don't provide yet. The NO_PROXY translation and the warehouse-exact filtering look correct and are well tested. Nit: the WithKernelProxy doc comment still says "basic-auth credentials", while the struct docs now also cover RFC 1929 for SOCKS5.
| - Evict kernel connections when SEA reports a missing or invalid session, and reject later requests locally without replaying the failed statement. | ||
| - Reduce Thrift row-scan CPU by binding scalar readers and null/type handling once per Arrow record (databricks/databricks-sql-go#602). | ||
| - **Behavior change:** Closed Thrift Arrow row scanners return an explicit error without logging an ERROR instead of stale values; a destination whose column count differs from the Arrow holders now errors instead of filling leading columns or NULL-padding missing columns. Column-value setup failures now stop scanning and are retained for subsequent scans instead of only being logged and ignored (databricks/databricks-sql-go#602). | ||
| - Support SOCKS proxies on the kernel backend; see [Proxy](CONNECTION_PARAMETERS.md#proxy). |
There was a problem hiding this comment.
🟠 High — The CHANGELOG and docs advertise kernel SOCKS support, but this PR does not touch KERNEL_REV or the v1.5.0 per-platform bindings in go.mod. I found no SOCKS handling in the kernel Go wrapper, so the pinned native kernel probably still rejects SOCKS URLs, including the socks5h:// URL this code produces. Bump the pins to a SOCKS-capable kernel release, or hold the changelog and docs entries until then.
🔀 Found by both reviewers · confirmed by the judge
Summary
Makes SOCKS proxies from the environment behave on the kernel backend as they do on the Thrift backend, using the kernel's SOCKS support (databricks/databricks-sql-kernel#518).
HTTP(S)_PROXYsocks5://URL is passed to the kernel assocks5h://, because net/http lets the proxy resolvesocks5://host names. When the warehouse would use asocks4://orsocks4a://proxy, the connection fails withErrInvalidKernelConfig, as net/http can't use them either; the error names the scheme, never the URL. WhenNO_PROXYbypasses the warehouse, such a proxy is passed to the kernel, which uses it (never a direct connection) for any other host that selects it.NO_PROXYis translated into the kernel's bypass list, also when it bypasses the warehouse. The warehouse always followshttp.ProxyFromEnvironmentexactly. For other hosts the kernel matches host names only, sohost:portentries apply only with port 443, and.example.comalso bypassesexample.com.CONNECTION_PARAMETERS.mddocuments both; exact per-host routing needs a kernel API change and is a separate follow-up. The environment is read once per process, as on the Thrift path.WithKernelProxyURLs, credentials and bypass lists still pass through unchanged; its docs now mention SOCKS URLs.ALL_PROXYset, the driver passes no proxy and the kernel reads the environment itself (Thrift ignoresALL_PROXY). This is documented.No options are added or renamed, and defaults are unchanged.
Dependencies
Needs databricks/databricks-sql-kernel#518.
KERNEL_REVstill pins3b691d2, which rejects SOCKS URLs, somake test-kernelon the default path doesn't exercise SOCKS until the pin moves to the merged kernel commit. That update follows #518's merge, and the published kernel bindings ingo.modmove with the kernel release.Validation
CGO_ENABLED=0):TestProxyForEndpointandTestKernelBypassHostscover socks5 → socks5h and socks4/4a rejection.*, and IP/CIDR entries.TestResolveKernelProxyEnvironmentruns each case in a child process with a real environment, includingALL_PROXYalone andWithKernelProxywinning over the environment.go vet,go test -raceand the-tags databricks_kerneltests pass, and lint reports no new findings.socks5h/socks5send the domain to the proxy, as on Thrift.NO_PROXYhost and suffix entries go direct,ALL_PROXYalone works, andWithKernelProxywins over the environment.SELECT 1throughsocks5hstayed withinmax(+25 %, +150 ms)of direct on both engines.This pull request and its description were written by Isaac.