Repository navigation
proxy: add DNS pre-resolution for provider endpoints - #55
Open
BenediktChlopik wants to merge 4 commits into
Open
BenediktChlopik wants to merge 4 commits into
BenediktChlopik wants to merge 4 commits into
Conversation
On config load/reload, asynchronously pre-resolve DNS for all enabled provider BaseURLs so the first request doesn't pay a cold DNS lookup. Failures are logged but don't block the proxy.
BenediktChlopik
marked this pull request as draft
November 22, 2026 12:18
Owner
|
Thanks for this, Benedikt! Warming DNS on load/reload fits the project's focus on speed, and running it in the background so it never blocks startup is the right design. One blocker before I can look closer:
Once it's rebased, two small questions:
Thanks again, looking forward to the rebased version! |
BenediktChlopik
force-pushed
the
dns-pre-resolution
branch
from
November 30, 2026 10:40
547842a to
99f4207
Compare
The goroutine spawned by UpdateConfig was reading cfg.Providers while the caller could mutate it after UpdateConfig returned (as done in TestDirectModel_UsesBuildBody). Snapshot the DNS hosts before spawning the goroutine so the lookup runs on a detached copy.
BenediktChlopik
marked this pull request as ready for review
November 30, 2026 11:04
added 2 commits
November 30, 2026 12:07
Verifies that UpdateConfig with an unresolvable provider hostname: - Returns without error (does not block on DNS) - Logs the failure asynchronously - Leaves the server functional for subsequent requests
Contributor
Author
|
For the 500-line change, I tried using GitHub Copilot to fix the data race, but it didn’t help. free-llm-proxy-router’s coding strategy does a better job :) |
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.
On config load/reload, asynchronously pre-resolve DNS for all enabled provider BaseURLs so the first request doesn't pay a cold DNS lookup. Failures are logged but don't block the proxy.
~10–50 ms saved on first request per provider