Repository navigation
Conversation
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Map httpx's redirect-exceeded error to a urllib HTTPError with a status-shaped reason, and other transport errors to URLError, so callers see what urllib would have raised. Normalize scheme-less macOS system proxies to http:// URLs as urllib's proxy handler does. Route the unauthenticated workspace host-type probe through the pooled client. Co-authored-by: Isaac <no-reply@databricks.com>
The host-type probe rides the pooled client now, so patch _http_open instead of urlopen; error-shape expectations are unchanged. Co-authored-by: Isaac <no-reply@databricks.com>
tls.apply() runs before the pooled client's SSL context is built, so it verifies against the same trust store (UG_TLS_TRUST_STORE, state.json, default os) as the urllib path did, keeping the inspection-proxy fix. A test pins the ordering and reuses the helper's context. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
JTSIV1
force-pushed
the
jtsiv1/ug-pooled-http
branch
from
November 20, 2026 14:17
c4986a7 to
c196246
Compare
Co-authored-by: Isaac <no-reply@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
httpx.Clientper process instead of a newurllibconnection per request._http_openreturns a urllib-compatible response, so callers keep the same headers, timeouts, retries and error strings.Authorizationon cross-origin redirects, where urllib re-sent it.getproxies(),proxy_bypass) are honored, including scheme-lesshost:portvalues./.well-known/databricks-config) uses the same pool.mcp_oauth,mcp_web_searchand the routing hook stay on urlopen since they run after handoff.HTTPError/URLErrorshapes, so retry routing is unchanged.tls.apply()(Fix SSL cert verification failures behind enterprise inspection proxies #168), so it verifies against the same trust store urllib did (osby default, orpython), and Fix SSL cert verification failures behind enterprise inspection proxies #168's certificate-failure hint still shows.Why
A new HTTPS connection to the workspace costs about 4 round trips: 0.035 s from us-west-2, 0.255 s from us-east-1, 0.94 s from ap-south-1. A reused one costs about 1.
ug configureandug claudeeach make several workspace calls, and every one of them paid the full handshake.UG's lookups (probe, discovery, catalog), median of 8 runs:
TCP connects per run: 12 → 8.
Testing
test_tls.py,test_tls_https.py, which run every client against a local HTTPS server under both trust stores) pass on the pooled transport. A new test checks the SSL context is built aftertls.apply().This pull request and its description were written by Isaac.