Skip to content

Fail system startup when a DNS listener cannot bind - #2524

Open
srivilliamsai wants to merge 1 commit into
apple:mainfrom
srivilliamsai:codex/dns-startup-bind-failure
Open

srivilliamsai wants to merge 1 commit into
apple:mainfrom
srivilliamsai:codex/dns-startup-bind-failure

Conversation

@srivilliamsai

@srivilliamsai srivilliamsai commented Nov 14, 2026 •

Copy link
Copy Markdown

Type of Change

  • Bug fix

Motivation and Context

Fixes #2519.

When another process holds either loopback DNS port, container system start can exit successfully with DNS unavailable. Bind both UDP listeners before starting plugins or exposing the normal API. If a bind fails, return the resolver name, endpoint, and socket error through the existing health check. The CLI removes the launchd job it registered so the next start can succeed once the port is free.

Testing

  • Tested locally

  • Added regression coverage

  • Reproduced on Apple silicon. Before the fix, system start and system status both exited 0 with either port held. After the fix, both exit 1, and startup names the resolver and port and reports the bind error.

  • After releasing each port, startup and status succeeded without an intervening stop. Both listeners answered DNS queries on a host without /etc/resolver, and invoking start again preserved the running service.

  • Ran an Alpine container after recovery and resolved its registered name, dnsprobe.test, on UDP port 2053.

  • Built container and container-apiserver with warnings treated as errors. All 94 DNS tests passed, including the UDP bind conflict regression, and make check passed.

  • The full test build reached the host's disk limit, so the full make verify run remains for CI.

This branch has not been deployed

No deployments
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.

[Bug]: system start reports success when the DNS server can't bind 127.0.0.1:2053

1 participant