Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 97502
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: Thomas.Erhardt [...] n3k.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Net::DNS::Resolver->retrans does not accept a value of 1 (uses 2 instead)
Date: Fri, 25 Jul 2014 17:57:01 +0200
To: "bug-Net-DNS [...] rt.cpan.org" <bug-Net-DNS [...] rt.cpan.org>
From: Thomas Erhardt <Thomas.Erhardt [...] n3k.de>
Hi, I think I did find an issue with Net::DNS::Resolver's retransfer which always seems to use a minimum of 2 seconds. -Net::DNS Version: tried 0.66 and 0.78 -Perl Version: 5.8.8 -OS: RedHat Linux 5.9 -Sample Code: qipadmin@runIP200:/var/tmp> cat lookup-min.pl #!/usr/bin/perl -w use strict; use Net::DNS; my @anycast_addresses; ### configuration - start push @anycast_addresses, "10.10.10.18"; my $resolver_retry = 2; my $resolver_retrans = 1; ### configuration - end my $res = Net::DNS::Resolver->new(); $res->nameservers(@anycast_addresses); $res->retry($resolver_retry); $res->retrans($resolver_retrans); my $version = ${Net::DNS::VERSION}; my $time = localtime(time); print "$time - sending query using Net::DNS $version\n"; my $query = $res->send("127.0.0.1"); $time = localtime(time); if ($query) { print "$time - received response\n"; } else { print "$time - query failed: ", $res->errorstring, "\n"; } qipadmin@runIP200:/var/tmp> -Expected result (as 10.10.10.18 is not reachable): * 2 Queries for 1.0.0.127.in-addr.arpa are sent (as $res->retry is set to 2) * 2nd query is sent one second after 1st (as $res->retrans is set to 1) Test: qipadmin@runIP200:/var/tmp> tcpdump -nn host 10.10.10.18 & [1] 6486 qipadmin@runIP200:/var/tmp> tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes qipadmin@runIP200:/var/tmp> ./lookup-min.pl Fri Jul 25 17:45:34 2014 - sending query using Net::DNS 0.66 17:45:34.874533 IP 192.168.32.64.53898 > 10.10.10.18.53: 59695+ PTR? 1.0.0.127.in-addr.arpa. (40) 17:45:36.875742 IP 192.168.32.64.53898 > 10.10.10.18.53: 59695+ PTR? 1.0.0.127.in-addr.arpa. (40) Fri Jul 25 17:45:40 2014 - query failed: query timed out qipadmin@runIP200:/var/tmp> fg tcpdump -nn host 10.10.10.18 ^C 2 packets captured 2 packets received by filter 0 packets dropped by kernel qipadmin@runIP200:/var/tmp> -Actual result: * 2 Queries are sent (good) * 2nd query happens 2 seconds after 1st query as you can see from the tcpdump timestamps but should happen after 1s due to the retransfer setting - is this a bug or intended behaviour? -Additional Remarks: * 2nd query times out after 4 seconds (exponential backoff?) resulting in a total timeout of 6s. * I reckon $res->udp_timeout (not used here) controls to timeout of one $res->send and not of the individual retries within that send Regards Thomas

Message body is not shown because it is too large.

Subject: Net::DNS::Resolver->udp_timeout always doubles the value given
Date: Fri, 25 Jul 2014 18:10:26 +0200
To: "bug-Net-DNS [...] rt.cpan.org" <bug-Net-DNS [...] rt.cpan.org>
From: Thomas Erhardt <Thomas.Erhardt [...] n3k.de>
Hi, I think I did find an issue with Net::DNS::Resolver's udp_timeout which always seems to double the value specified. -Net::DNS Version: tried 0.66 and 0.78 -Perl Version: 5.8.8 -OS: RedHat Linux 5.9 -Sample Code: qipadmin@runIP200:/var/tmp> cat lookup-min.pl #!/usr/bin/perl -w use strict; use Net::DNS; my @anycast_addresses; ### configuration - start push @anycast_addresses, "10.10.10.18"; my $resolver_udp_timeout = 1; ### configuration - end my $res = Net::DNS::Resolver->new(); $res->nameservers(@anycast_addresses); $res->udp_timeout($resolver_udp_timeout); my $version = ${Net::DNS::VERSION}; my $time = localtime(time); print "$time - sending query using Net::DNS $version\n"; my $query = $res->send("127.0.0.1"); $time = localtime(time); if ($query) { print "$time - received response\n"; } else { print "$time - query failed: ", $res->errorstring, "\n"; } -Expected result (as 10.10.10.18 is not reachable): * 1 query for 1.0.0.127.in-addr.arpa is sent which times out after 1 second (as $res->udp_timeout is set to 1) Test: qipadmin@runIP200:/var/tmp> tcpdump -nn host 10.10.10.18 & [1] 29126 qipadmin@runIP200:/var/tmp> tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes qipadmin@runIP200:/var/tmp> ./lookup-min.pl Fri Jul 25 18:06:12 2014 - sending query using Net::DNS 0.66 18:06:12.934679 IP 192.168.32.64.51691 > 10.10.10.18.53: 10060+ PTR? 1.0.0.127.in-addr.arpa. (40) Fri Jul 25 18:06:14 2014 - query failed: query timed out qipadmin@runIP200:/var/tmp> fg tcpdump -nn host 10.10.10.18 ^C 1 packets captured 1 packets received by filter 0 packets dropped by kernel qipadmin@runIP200:/var/tmp> -Actual result: * 1 query is sent (good) * timeout happens after 2 seconds (instead of 1) * if I use a udp_timeout of 2 the timeout actually happens after 4 seconds, so it always seems to double what I specify: is this a bug or intended behaviour? Regards Thomas
From: rwfranks [...] acm.org
On Fri Jul 25 11:57:24 2014, Thomas.Erhardt@n3k.de wrote: Show quoted text
> I think I did find an issue with Net::DNS::Resolver's retransfer which > always seems to use a minimum of 2 seconds. > > -Net::DNS Version: tried 0.66 and 0.78 > -Perl Version: 5.8.8 > -OS: RedHat Linux 5.9
This bug is much older than that! Broken in 0.50 (2005) Good catch, thanks.
Subject: AW: [rt.cpan.org #97502] Net::DNS::Resolver->retrans does not accept a value of 1 (uses 2 instead)
Date: Mon, 28 Jul 2014 13:21:39 +0200
To: "bug-Net-DNS [...] rt.cpan.org" <bug-Net-DNS [...] rt.cpan.org>
From: Thomas Erhardt <Thomas.Erhardt [...] n3k.de>
Hi, strange that nobody noticed before. Maybe [rt.cpan.org #97506] is the same issue / is caused by the same bug. Regards Thomas Show quoted text
> -----Ursprüngliche Nachricht----- > Von: Dick Franks via RT [mailto:bug-Net-DNS@rt.cpan.org] > Gesendet: Montag, 28. Juli 2014 13:13 > An: Thomas Erhardt > Betreff: [rt.cpan.org #97502] Net::DNS::Resolver->retrans does not accept a value of 1 (uses 2 instead) > > <URL: https://rt.cpan.org/Ticket/Display.html?id=97502 > > > On Fri Jul 25 11:57:24 2014, Thomas.Erhardt@n3k.de wrote: >
> > I think I did find an issue with Net::DNS::Resolver's retransfer which > > always seems to use a minimum of 2 seconds. > > > > -Net::DNS Version: tried 0.66 and 0.78 > > -Perl Version: 5.8.8 > > -OS: RedHat Linux 5.9
> > This bug is much older than that! > Broken in 0.50 (2005) > > Good catch, thanks.
Fix will be in 0.79