Skip to content

fix: add DNS resilience for BuildKit containers#109

Closed
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1782237394-dns-resilience
Closed

fix: add DNS resilience for BuildKit containers#109
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1782237394-dns-resilience

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Addresses recurring EAI_AGAIN / ETIMEDOUT failures during Docker builds when BuildKit containers can't resolve npm/Docker registry hostnames through the sole systemd-resolved nameserver. Observed ~103 Docker - Build API failures for naboo-team in the last 30 days (eu-west ARM runners), all caused by transient DNS resolution failures inside BuildKit containers.

Two changes:

  1. DNS health-check after systemd-resolved restartwaitForDnsReady() polls getent hosts against registry.npmjs.org + registry-1.docker.io with 500ms intervals up to 10s, ensuring the resolver is responsive before BuildKit starts issuing queries.

  2. Add a public DNS fallback to BuildKit's nameserver configgetRoutableHostDns() now returns [hostIp, "8.8.8.8"] instead of [hostIp]. BuildKit round-robins across nameservers (not ordered fallback), so ~50% of queries still hit the local systemd-resolved cache while the other 50% go direct to Google DNS. This is a deliberate trade-off: we lose some cache efficiency but gain resilience when systemd-resolved is transiently unavailable.

- return [hostIp];              // single point of failure
+ return [hostIp, "8.8.8.8"];   // local cache + public fallback

Link to Devin session: https://app.devin.ai/sessions/6d41a8230c874dcaa490df945caa2315


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled. (Staging)

- Add DNS health-check after systemd-resolved restart to verify
  resolution is working before handing the nameserver to BuildKit
- Add a public DNS fallback (8.8.8.8) alongside the host IP in
  BuildKit's nameserver config for redundancy against transient
  systemd-resolved failures (EAI_AGAIN / ETIMEDOUT)

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@pbardea

pbardea commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

This reverts to behavior that we saw in #63 which actually reduced the amount of these DNS errors.

@pbardea pbardea closed this Jun 27, 2026
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.

2 participants