Make S3 endpoint hostname resolution opt-in - #19
Closed
ptomecek wants to merge 1 commit into
Closed
Conversation
_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>
Contributor
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.
_storage_options_forresolved 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_RESOLVEset. Default behaviour is now pass-through (no resolution); deployments that want it opt in: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. Fulltest_util,test_delta_io,test_lazy_cache_parquetpass; ruff clean.