[TRIVIAL] Enable reqwest's async DNS resolution (hickory-dns)#4564
Conversation
This update brings the reqwest version into "sync" which will enable setting async DNS resolution for all reqwest callers
reqwest's DNS resolution is blocking by default, using getaddrinfo from the OS, when the DNS resolution is slow, this leads to increased latency in services (especially the autopilot), the async resolution allows reqwest to play nicer with tokio
|
Claude finished @jmg-duarte's task in 1m 23s —— View job PR Review: Enable async DNS resolution (hickory-dns)
Verdict: LGTM — small, well-scoped, low-risk change. The The One non-blocking behavioral note posted inline re: in-process DNS caching / |
There was a problem hiding this comment.
Code Review
This pull request enables the hickory-dns feature for the reqwest dependency in Cargo.toml, updating Cargo.lock with the necessary transitive dependencies including hickory-resolver and hickory-proto. No critical issues were found, and there is no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| regex = "1.10.4" | ||
| request-sharing = { path = "crates/request-sharing" } | ||
| reqwest = "0.13" | ||
| reqwest = { version = "0.13", features = ["hickory-dns"] } |
There was a problem hiding this comment.
Worth being aware of one behavioral difference vs. the OS getaddrinfo path: the hickory resolver reads /etc/resolv.conf once at client construction and then caches DNS records in-process per their TTL (via moka). Long-lived clients (e.g. the autopilot's, which are built once at startup) will therefore not pick up resolv.conf changes for the process lifetime, and will honor record TTLs for cache expiry rather than re-resolving every call the way glibc does.
In k8s this is almost always fine (and is largely the point of the change), but it's the kind of difference that can surface as stale upstream IPs after a backend redeploy if a record has a very long/absent TTL. Might be worth a quick sanity check in prod after rollout that connection-error/latency metrics look healthy.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
AryanGodara
left a comment
There was a problem hiding this comment.
Had to read up a bit on hickory 😅 , but LGTM 👌🏼
reqwest's DNS resolution is blocking by default, using getaddrinfo from the OS, when the DNS resolution is slow, this leads to increased latency in services (especially the autopilot), the async resolution allows reqwest to play nicer with tokio
Enabling the feature will enable hickory by default:
https://github.com/seanmonstar/reqwest/blob/ea3d9ca6877620aa571cd67246c0c37a09fdd2e8/src/async_impl/client.rs#L369
The previous OTel reqwest unification allows everything on our stack that depends on reqwest to take advantage of the async DNS
Additionally, it bumps reqwest because 0.13.2 would depend on a vulnerable version of hickory (see GHSA-3v94-mw7p-v465 and GHSA-q2qq-hmj6-3wpp)