Bug #8285
closedResolv::DNS: TCP fallback fails with multiple resolvers
Description
Since my TCP fallback support patch from #3835 was merged Resolv::DNS would sometimes fail with a @"host/port don't match: :"@ @Resolv::DNS::Requester::RequestError@ exception in @resolv.rb@, line 818 (Ruby 1.9.1). This happens when more than one nameserver is configured and Resolv::DNS is has fallen back to TCP and rotates from the first to the second nameserver (e.g., when there was a timeout in the TCP query to the first nameserver).
Files
Updated by julian.mehnle (Julian Mehnle) over 11 years ago
- File ruby-trunk-8285-resolv-tcp-fallback-fix.diff ruby-trunk-8285-resolv-tcp-fallback-fix.diff added
The problem is caused by my original TCP fallback code reusing a Resolv::DNS::Requester::TCP::Sender object that was initialized for one (the first) nameserver with a Resolv::DNS::Requester::TCP object that was initialized for another (the second) nameserver, and the TCP requester detecting a host/port mismatch between itself and the sender. (The fact that both the requester and the sender are aware of the nameserver's host and port is a design bug in the original code, but I opted not to fix that.)
This patch fixes my original TCP fallback code to keep one sender per requester, thereby avoiding mismatch situations. (Also this patch gracefully handles the nameserver refusing a TCP connection (raised as an Errno::ECONNREFUSED exception) by treating it like a timeout.)
Updated by julian.mehnle (Julian Mehnle) over 11 years ago
Why has @monospace@ formatting been disabled in this Redmine? Bleh!
Updated by julian.mehnle (Julian Mehnle) over 11 years ago
Also, ruby -v actually is: ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-darwin11]
Updated by akr (Akira Tanaka) over 10 years ago
After ruby-trunk-8285-resolv-tcp-fallback-fix.diff is applied,
lib/resolv.rb has a syntax error.
% ruby -c lib/resolv.rb
lib/resolv.rb:524: syntax error, unexpected tOP_ASGN
protocol = protocols[candidate| ||= :udp
^
Updated by akr (Akira Tanaka) over 10 years ago
- Status changed from Open to Feedback
Updated by jeremyevans0 (Jeremy Evans) about 5 years ago
- Status changed from Feedback to Closed
- Backport deleted (
1.9.3: UNKNOWN, 2.0.0: UNKNOWN)