Skip to content

dns: print failure message when EAI_AGAIN retries are exhausted#43

Merged
ktsaou merged 1 commit intomasterfrom
dns-eai-again-final-message
Apr 7, 2026
Merged

dns: print failure message when EAI_AGAIN retries are exhausted#43
ktsaou merged 1 commit intomasterfrom
dns-eai-again-final-message

Conversation

@ktsaou
Copy link
Copy Markdown
Member

@ktsaou ktsaou commented Apr 7, 2026

Summary

When getaddrinfo returns EAI_AGAIN ("Temporary failure in name resolution"), iprange retries the request up to 20 times. After the last retry the request was silently completed — no final diagnostic was printed, even though the overall command still exits non-zero.

On systems without network connectivity (e.g. distribution package build VMs, as reported in #42 for openSUSE), the user sees twenty will be retried lines and then nothing. It also breaks tests.d/64-dns-failure-exit-status, which greps stderr for failed permanently — a string only emitted on the EAI_NONAME path.

This change mirrors the EAI_NONAME branch and emits a failed permanently after retries message before completing the request, so both the user and the test get a clear final error regardless of whether the resolver reached a server.

Fixes #42

Test plan

  • make clean in build-default/
  • Full suite (93 tests) green on a machine with working DNS
  • tests.d/64-dns-failure-exit-status passes inside an offline network namespace (unshare -r -n)
  • Manual offline run prints the new failed permanently after retries line and exits 1

When getaddrinfo returns EAI_AGAIN ("Temporary failure in name
resolution"), iprange retries the request up to 20 times. After the last
retry, the request was silently completed without any final diagnostic.

On systems without network connectivity (e.g. distribution package build
VMs), this causes the user to see twenty "will be retried" lines and
then nothing, even though the command exits non-zero. It also breaks
tests.d/64-dns-failure-exit-status, which greps stderr for "failed
permanently" — a string only emitted on the EAI_NONAME path.

Mirror the EAI_NONAME branch and emit a "failed permanently after
retries" message before completing the request, so the user (and the
test) get a clear final error regardless of whether the resolver reached
a server.

Fixes #42
@ktsaou ktsaou merged commit f84a706 into master Apr 7, 2026
8 checks passed
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.

Tests: 64-dns-failure-exit status fails without network connection

1 participant