Dev's Rust DNS Resolver Journey: Socket Leaks, Bloated Dependencies, and Hard Lessons
A developer built a custom Rust DNS resolver as a lighter alternative to trust-dns, only to face a file descriptor leak reported by a user running the library in production. Investigation revealed the leak stemmed not from the resolver itself but from a transitive dependency, prompting an audit that uncovered 87 crates in the dependency graph — many unnecessary. Removing unused packages like tokio-postgres and serde_json cut binary size from 4.2 MB to 1.8 MB and build time from 92 to 37 seconds. A missing IPv6 implementation and a release-mode integer overflow further highlighted gaps that only emerged under real-world conditions. The developer concluded that building open-source software publicly carries genuine costs in scrutiny and public failures, but also tangible benefits through community contributions like bug fixes and fuzz targets.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in