Skip to content

Make S3 endpoint hostname resolution opt-in - #19

Closed
ptomecek wants to merge 1 commit into
mainfrom
feat/opt-in-endpoint-resolution
Closed

Make S3 endpoint hostname resolution opt-in#19
ptomecek wants to merge 1 commit into
mainfrom
feat/opt-in-endpoint-resolution

Conversation

@ptomecek

Copy link
Copy Markdown
Collaborator

_storage_options_for resolved the endpoint hostname to an IP for every S3 endpoint. That is only safe for plain-HTTP on-prem object stores (where resolving up front avoids overloading DNS when many workers connect at once) — for an HTTPS endpoint it replaces the hostname with an IP and breaks TLS certificate validation.

This gates the resolution on a new, empty-by-default ENDPOINTS_TO_RESOLVE set. Default behaviour is now pass-through (no resolution); deployments that want it opt in:

from polars_io_tools.io_sources import util
util.ENDPOINTS_TO_RESOLVE.add("http://onprem-store:9020")

The existing tests used non-resolvable hostnames (so the old unconditional call was already a no-op via gaierror); adds tests for both the opt-in (resolved) and default (pass-through) paths. Full test_util, test_delta_io, test_lazy_cache_parquet pass; ruff clean.

_storage_options_for resolved the endpoint hostname to an IP for every S3
endpoint. That is only safe for plain-HTTP on-prem object stores (where it
avoids overloading DNS when many workers connect at once); doing it for an
HTTPS endpoint replaces the hostname with an IP and breaks TLS certificate
validation.

Gate the resolution on a new, empty-by-default `ENDPOINTS_TO_RESOLVE` set.
Deployments that want it opt in by adding the specific endpoint URLs, e.g.
`ENDPOINTS_TO_RESOLVE.add("http://onprem-store:9020")`. Existing tests used
non-resolvable hostnames and so were unaffected by the old unconditional
behaviour; add tests for both the opt-in and pass-through paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Pascal Tomecek <40371786+ptomecek@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

1 392 tests  +2   1 344 ✅ +2   40s ⏱️ -1s
    2 suites ±0      48 💤 ±0 
    2 files   ±0       0 ❌ ±0 

Results for commit 5751272. ± Comparison against base commit a4a16e5.

@ptomecek ptomecek closed this Aug 20, 2026
@ptomecek
ptomecek deleted the feat/opt-in-endpoint-resolution branch August 20, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant