dns: print failure message when EAI_AGAIN retries are exhausted#43
Merged
dns: print failure message when EAI_AGAIN retries are exhausted#43
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
getaddrinforeturnsEAI_AGAIN("Temporary failure in name resolution"),iprangeretries 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 retriedlines and then nothing. It also breakstests.d/64-dns-failure-exit-status, which greps stderr forfailed permanently— a string only emitted on theEAI_NONAMEpath.This change mirrors the
EAI_NONAMEbranch and emits afailed permanently after retriesmessage 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
makeclean inbuild-default/tests.d/64-dns-failure-exit-statuspasses inside an offline network namespace (unshare -r -n)failed permanently after retriesline and exits 1