Repository navigation
Fail over when writing a request finds the TCP peer gone - #148
Merged
Merged
Conversation
Three tests carry the same hand built reply, and the tests below need a fourth. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A peer that goes away while another nameserver is being tried leaves a socket nobody is watching, so the loss only surfaces when the next request is written to it, as Errno::EPIPE. Config#resolv moves on to the next nameserver for ResolvTimeout alone, so that escaped Resolv::DNS#getresources and ended the whole resolution. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Resolv::DNS#getresourcescan raise a rawErrno::EPIPEand abandon the whole resolution while nameservers are still untried. It happens when a TCP nameserver's peer goes away while the client is busy with another one. Nothing is watching that socket, so the loss only surfaces when the next request is written to it, andConfig#resolvmoves on to the next nameserver forResolvTimeoutalone.The send side of
Requester#requestnow treats a lost peer the way the receive side already treats one, and the requester remembers the failure so the following round starts from a new connection rather than the dead socket.I found this with a reproduction during the review of #137, where it was left out as pre-existing.
Generated with Claude Code