🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
33 messages
33 total messages Started by D. Stussy Wed, 30 Jan 2008 22:11
Regarding INN - name to address resolution for peers
#78616
Author: D. Stussy
Date: Wed, 30 Jan 2008 22:11
12 lines
1484 bytes
Currently using "INN 2.4.4 (20080101 snapshot)" - with IPV6 enabled.  All
configuration files currently specify hostnames for peers.

Q1)  Will "innfeed" always make an "AAAA" query first and use IPv6
addressing if found?

Q2)  Does "innfeed" maintain information regarding which address(es) of a
multi-homed host respond(s) better(best) and then try that(those) address
first on future connections?


Re: Regarding INN - name to address resolution for peers
#78617
Author: Russ Allbery
Date: Wed, 30 Jan 2008 22:41
23 lines
1892 bytes
"D. Stussy" <spam@bde-arc.ampr.org> writes:

> Currently using "INN 2.4.4 (20080101 snapshot)" - with IPV6 enabled.  All
> configuration files currently specify hostnames for peers.
>
> Q1)  Will "innfeed" always make an "AAAA" query first and use IPv6
> addressing if found?

I believe so.

> Q2)  Does "innfeed" maintain information regarding which address(es) of a
> multi-homed host respond(s) better(best) and then try that(those) address
> first on future connections?

No.  It tries the addresses for a host in the order in which they're
returned by getaddrinfo and uses whichever it can successfully connect to
first.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Regarding INN - name to address resolution for peers
#78618
Author: D. Stussy
Date: Thu, 31 Jan 2008 01:23
27 lines
1950 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:877ihrdjha.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
>
> > Currently using "INN 2.4.4 (20080101 snapshot)" - with IPV6 enabled.
All
> > configuration files currently specify hostnames for peers.
> >
> > Q1)  Will "innfeed" always make an "AAAA" query first and use IPv6
> > addressing if found?
>
> I believe so.
>
> > Q2)  Does "innfeed" maintain information regarding which address(es) of
a
> > multi-homed host respond(s) better(best) and then try that(those)
address
> > first on future connections?
>
> No.  It tries the addresses for a host in the order in which they're
> returned by getaddrinfo and uses whichever it can successfully connect to
> first.

OK.  Thank you.

Re: Regarding INN - name to address resolution for peers
#78619
Author: D. Stussy
Date: Thu, 31 Jan 2008 01:23
27 lines
1950 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:877ihrdjha.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
>
> > Currently using "INN 2.4.4 (20080101 snapshot)" - with IPV6 enabled.
All
> > configuration files currently specify hostnames for peers.
> >
> > Q1)  Will "innfeed" always make an "AAAA" query first and use IPv6
> > addressing if found?
>
> I believe so.
>
> > Q2)  Does "innfeed" maintain information regarding which address(es) of
a
> > multi-homed host respond(s) better(best) and then try that(those)
address
> > first on future connections?
>
> No.  It tries the addresses for a host in the order in which they're
> returned by getaddrinfo and uses whichever it can successfully connect to
> first.

OK.  Thank you.

Re: Regarding INN - name to address resolution for peers
#78620
Author: D. Stussy
Date: Thu, 31 Jan 2008 01:23
27 lines
1950 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:877ihrdjha.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
>
> > Currently using "INN 2.4.4 (20080101 snapshot)" - with IPV6 enabled.
All
> > configuration files currently specify hostnames for peers.
> >
> > Q1)  Will "innfeed" always make an "AAAA" query first and use IPv6
> > addressing if found?
>
> I believe so.
>
> > Q2)  Does "innfeed" maintain information regarding which address(es) of
a
> > multi-homed host respond(s) better(best) and then try that(those)
address
> > first on future connections?
>
> No.  It tries the addresses for a host in the order in which they're
> returned by getaddrinfo and uses whichever it can successfully connect to
> first.

OK.  Thank you.

Re: Regarding INN - name to address resolution for peers
#78621
Author: D. Stussy
Date: Thu, 31 Jan 2008 01:23
27 lines
2060 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:877ihrdjha.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
>
> > Currently using "INN 2.4.4 (20080101 snapshot)" - with IPV6 enabled.
All
> > configuration files currently specify hostnames for peers.
> >
> > Q1)  Will "innfeed" always make an "AAAA" query first and use IPv6
> > addressing if found?
>
> I believe so.
>
> > Q2)  Does "innfeed" maintain information regarding which address(es) of
a
> > multi-homed host respond(s) better(best) and then try that(those)
address
> > first on future connections?
>
> No.  It tries the addresses for a host in the order in which they're
> returned by getaddrinfo and uses whichever it can successfully connect to
> first.

OK.  Thank you.

Re: Regarding INN - name to address resolution for peers
#78623
Author: D. Stussy
Date: Thu, 31 Jan 2008 01:23
27 lines
1950 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:877ihrdjha.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
>
> > Currently using "INN 2.4.4 (20080101 snapshot)" - with IPV6 enabled.
All
> > configuration files currently specify hostnames for peers.
> >
> > Q1)  Will "innfeed" always make an "AAAA" query first and use IPv6
> > addressing if found?
>
> I believe so.
>
> > Q2)  Does "innfeed" maintain information regarding which address(es) of
a
> > multi-homed host respond(s) better(best) and then try that(those)
address
> > first on future connections?
>
> No.  It tries the addresses for a host in the order in which they're
> returned by getaddrinfo and uses whichever it can successfully connect to
> first.

OK.  Thank you.

Re: Regarding INN - name to address resolution for peers
#78644
Author: Marco d'Itri
Date: Mon, 04 Feb 2008 22:17
10 lines
1165 bytes
spam@bde-arc.ampr.org wrote:

>Q1)  Will "innfeed" always make an "AAAA" query first and use IPv6
>addressing if found?
Yes. The Debian package has a patch to configure this behaviour, I do
not remember if it has been merged upstream yet.

-- 
ciao, |
Marco | * The Internet is full. Go away.  -- Joel Furr *
Re: Regarding INN - name to address resolution for peers
#78637
Author: D. Stussy
Date: Tue, 05 Feb 2008 04:38
26 lines
2302 bytes
"Marco d'Itri" <md@Linux.IT> wrote in message
news:fo82tr$14d$1@bongo.bofh.it...
> spam@bde-arc.ampr.org wrote:
>
> >Q1)  Will "innfeed" always make an "AAAA" query first and use IPv6
> >addressing if found?
> Yes. The Debian package has a patch to configure this behaviour, I do
> not remember if it has been merged upstream yet.

Apparently not.  Looking at innfeed/connection.c at about line 520, it looks
as if it tries to connect with the first address that gets returned (whether
it be IPv6 or IPv4) and upon failure, it sleeps/kills the connection and the
subroutine exits.  It should probably loop, trying ALL the addresses - in
the event that the name server and/or client resolvr library do not
randomize nor round-robin the results.

I'm looking at the (source of the) stable snapshot versioned as INN 2.4.4
dated 2008/01/01.

I've noted this in that one of my peers is apparently seeing the IPv6
address in the resolver and trying it, but fails to connect because his
kernel doesn't have IPv6 support compiled in (yet for some reason, his INN
and BIND do - maybe he's using precompiled versions; I'm waiting to hear
back).

Re: Regarding INN - name to address resolution for peers (follow-up)
#78638
Author: D. Stussy
Date: Tue, 05 Feb 2008 05:02
6 lines
1443 bytes
The peer in question that was having the problem recompiled his INN/innfeed
program with --disable-ipv6 (the default) and is now connecting normally.
Apparently, his DNS resolver was also IPv6 enabled but his kernel is NOT
(confirmed).

Re: Regarding INN - name to address resolution for peers
#78639
Author: Russ Allbery
Date: Tue, 05 Feb 2008 05:14
20 lines
2011 bytes
"D. Stussy" <spam@bde-arc.ampr.org> writes:

> Apparently not.  Looking at innfeed/connection.c at about line 520, it
> looks as if it tries to connect with the first address that gets
> returned (whether it be IPv6 or IPv4) and upon failure, it sleeps/kills
> the connection and the subroutine exits.  It should probably loop,
> trying ALL the addresses - in the event that the name server and/or
> client resolvr library do not randomize nor round-robin the results.
>
> I'm looking at the (source of the) stable snapshot versioned as INN 2.4.4
> dated 2008/01/01.

Hm, it may be that only CURRENT has the right code for IPv6.  The IPv6
support in CURRENT is much cleaner.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Regarding INN - name to address resolution for peers
#78640
Author: D. Stussy
Date: Tue, 05 Feb 2008 05:53
24 lines
2307 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:87ejbs0ytv.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
>
> > Apparently not.  Looking at innfeed/connection.c at about line 520, it
> > looks as if it tries to connect with the first address that gets
> > returned (whether it be IPv6 or IPv4) and upon failure, it sleeps/kills
> > the connection and the subroutine exits.  It should probably loop,
> > trying ALL the addresses - in the event that the name server and/or
> > client resolvr library do not randomize nor round-robin the results.
> >
> > I'm looking at the (source of the) stable snapshot versioned as INN
2.4.4
> > dated 2008/01/01.
>
> Hm, it may be that only CURRENT has the right code for IPv6.  The IPv6
> support in CURRENT is much cleaner.

I actually noted that the code is AF independent, but that it only tries the
first address returned from the first address family returned.  Technically,
if a non-IP address family record were returned (such as from an APL record
instead of A or AAAA), that would be tried too.

Re: Regarding INN - name to address resolution for peers
#78642
Author: Russ Allbery
Date: Tue, 05 Feb 2008 06:28
16 lines
1937 bytes
"D. Stussy" <spam@bde-arc.ampr.org> writes:

> I actually noted that the code is AF independent, but that it only tries
> the first address returned from the first address family returned.
> Technically, if a non-IP address family record were returned (such as
> from an APL record instead of A or AAAA), that would be tried too.

That sounds like a horribly broken getaddrinfo.  getaddrinfo specifically
looks up the address of a host.  It shouldn't be returning random other
DNS RRs, whether they be APL, MX, AFSDB, TXT, or anything else.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Regarding INN - name to address resolution for peers
#78643
Author: D. Stussy
Date: Tue, 05 Feb 2008 07:31
19 lines
2222 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:87odavzzlq.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
>
> > I actually noted that the code is AF independent, but that it only tries
> > the first address returned from the first address family returned.
> > Technically, if a non-IP address family record were returned (such as
> > from an APL record instead of A or AAAA), that would be tried too.
>
> That sounds like a horribly broken getaddrinfo.  getaddrinfo specifically
> looks up the address of a host.  It shouldn't be returning random other
> DNS RRs, whether they be APL, MX, AFSDB, TXT, or anything else.

I'm not saying that it would return an APL or other RRs - just that there
are other address families besides IPv4 and IPv6 and that it's possible that
there COULD be a return of something not IP and that the code (as of January
1) ignores that multiple AFs can be returned.

Re: Regarding INN - name to address resolution for peers
#78645
Author: Russ Allbery
Date: Tue, 05 Feb 2008 07:34
34 lines
2974 bytes
"D. Stussy" <spam@bde-arc.ampr.org> writes:
> "Russ Allbery" <rra@stanford.edu> wrote:

>> That sounds like a horribly broken getaddrinfo.  getaddrinfo
>> specifically looks up the address of a host.  It shouldn't be returning
>> random other DNS RRs, whether they be APL, MX, AFSDB, TXT, or anything
>> else.

> I'm not saying that it would return an APL or other RRs - just that
> there are other address families besides IPv4 and IPv6 and that it's
> possible that there COULD be a return of something not IP and that the
> code (as of January 1) ignores that multiple AFs can be returned.

I'm not sure what you think the code should do.  The intent of the
getaddrinfo interface is that, by using it, code can be AF-neutral and not
have to be constantly updated whenever new AFs show up (such as some
hypothetical IPv7), and more relevantly not have to care whether it gets
back IPv4 or IPv6.  I don't want to hard-code any address family
expectations; that's exactly counter to the whole point of the new
interfaces.

CURRENT provides more information via hints, such as telling getaddrinfo
that the address will be used for SOCK_STREAM.  I would be very surprised
if that's not sufficient.  CURRENT also correctly tries each address in
turn rather than giving up if the first one doesn't work.  The IPv6
support in 2.4 was sort of bolted on the side.  CURRENT uses the new
interfaces unconditionally and more cleanly and provides a compatibility
layer for systems that don't have them.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Regarding INN - name to address resolution for peers
#78646
Author: D. Stussy
Date: Tue, 05 Feb 2008 08:21
45 lines
3855 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:87prvbyhy9.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
> > "Russ Allbery" <rra@stanford.edu> wrote:
>
> >> That sounds like a horribly broken getaddrinfo.  getaddrinfo
> >> specifically looks up the address of a host.  It shouldn't be returning
> >> random other DNS RRs, whether they be APL, MX, AFSDB, TXT, or anything
> >> else.
>
> > I'm not saying that it would return an APL or other RRs - just that
> > there are other address families besides IPv4 and IPv6 and that it's
> > possible that there COULD be a return of something not IP and that the
> > code (as of January 1) ignores that multiple AFs can be returned.
>
> I'm not sure what you think the code should do.  The intent of the
> getaddrinfo interface is that, by using it, code can be AF-neutral and not
> have to be constantly updated whenever new AFs show up (such as some
> hypothetical IPv7), and more relevantly not have to care whether it gets
> back IPv4 or IPv6.  I don't want to hard-code any address family
> expectations; that's exactly counter to the whole point of the new
> interfaces.
>
> CURRENT provides more information via hints, such as telling getaddrinfo
> that the address will be used for SOCK_STREAM.  I would be very surprised
> if that's not sufficient.  CURRENT also correctly tries each address in
> turn rather than giving up if the first one doesn't work.  The IPv6
> support in 2.4 was sort of bolted on the side.  CURRENT uses the new
> interfaces unconditionally and more cleanly and provides a compatibility
> layer for systems that don't have them.

Look's like I need to see what changes to the source (stable) in the past
month before continuing, but it's clear that the January 1 snapshot of
innfeed did NOT cycle through the various AF's and addresses - simply trying
the first one (first address of the first AF) returned by the resolver - and
that was the problem my peer had with connecting to me in that he
consistently was trying to connect via an AF (IPv6) that his kernel didn't
support.  If this has been fixed, maybe 2.4.4 should be released instead of
waiting for 2.5.0?  Why?  With the root-servers.net now publishing IPv6
addresses, there may be more people shifting their machines toward that
transition and encountering this problem because they're running older INN
versions.  With an update and this issue in the changelog, maybe they'll
catch on and upgrade?

Re: Regarding INN - name to address resolution for peers
#78647
Author: Russ Allbery
Date: Tue, 05 Feb 2008 18:52
37 lines
3073 bytes
"D. Stussy" <spam@bde-arc.ampr.org> writes:

> Look's like I need to see what changes to the source (stable) in the
> past month before continuing, but it's clear that the January 1 snapshot
> of innfeed did NOT cycle through the various AF's and addresses - simply
> trying the first one (first address of the first AF) returned by the
> resolver - and that was the problem my peer had with connecting to me in
> that he consistently was trying to connect via an AF (IPv6) that his
> kernel didn't support.

CURRENT cycles through all available returns from getaddrinfo.  STABLE
does not.  The IPv6 support in STABLE is bolted on the side and isn't
finished.  CURRENT has native IPv6 support.

> If this has been fixed, maybe 2.4.4 should be released instead of
> waiting for 2.5.0?

I have had no time to work on INN for about a year and a half and no
prospects of that improving in the forseeable future.  :/  This has
seriously impacted the release schedule of INN.

Realistically, if there's anyone else who is interested in stepping up to
take on more of INN development, it's probably time for me to step down as
the release manager and lead developer, given that I'm doing neither.
I've been meaning to say something about that for a while, but I've
basically only had time to be reactive and hence don't think about it
until I'm responding to messages like this.

I'll go send that to inn-workers as well now that I'm thinking about it.
I'd been planning on doing that for a while and just hadn't taken the
time.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Regarding INN - name to address resolution for peers
#78649
Author: D. Stussy
Date: Tue, 05 Feb 2008 23:11
68 lines
5086 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:87fxw71bi4.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
>
> > Look's like I need to see what changes to the source (stable) in the
> > past month before continuing, but it's clear that the January 1 snapshot
> > of innfeed did NOT cycle through the various AF's and addresses - simply
> > trying the first one (first address of the first AF) returned by the
> > resolver - and that was the problem my peer had with connecting to me in
> > that he consistently was trying to connect via an AF (IPv6) that his
> > kernel didn't support.
>
> CURRENT cycles through all available returns from getaddrinfo.  STABLE
> does not.  The IPv6 support in STABLE is bolted on the side and isn't
> finished.  CURRENT has native IPv6 support.
>
> > If this has been fixed, maybe 2.4.4 should be released instead of
> > waiting for 2.5.0?
>
> I have had no time to work on INN for about a year and a half and no
> prospects of that improving in the forseeable future.  :/  This has
> seriously impacted the release schedule of INN.
>
> Realistically, if there's anyone else who is interested in stepping up to
> take on more of INN development, it's probably time for me to step down as
> the release manager and lead developer, given that I'm doing neither.
> I've been meaning to say something about that for a while, but I've
> basically only had time to be reactive and hence don't think about it
> until I'm responding to messages like this.
>
> I'll go send that to inn-workers as well now that I'm thinking about it.
> I'd been planning on doing that for a while and just hadn't taken the
> time.

I've sucked down today's copies (20080205) and I see in "stable" the hack
for the IPv6 AF.  I don't think that solves the problem in that it looks as
if there is a failure to create an IPv6 socket, no attempt at IPv4 is made,
nor does it seem to loop through alternate addresses (as you noted).

In looking at the "current" version, I note the comment at lines 31-34
indicating that "we should probably ... rotate through the address[es] when
one fails ...."  It looks as if what I have been saying is in fact a
variation of that - in that at least one should try at least one address
from each AF before failing the connection attempt.  Function "hostIpAddr()"
does seem to process multiple addresses in an AF-independent way and do so
periodically, and "hostIpFailed()" provides for cycling through them.
HOWEVER, in "cxnConnect()", we don't seem to rotate through the addresses
where there is a "can't create socket" or a "can't set socket non-blocking"
error by calling "hostIpFailed(cxn->myHost)" and I think we need to - else
we repeatedly try the same AF+address that failed the last time - in a
virtual infinite loop if it never succeeds (such as trying an IPv6 address
returned by the resolver on an IPv4-only kerneled host).

I don't know if we need the "hostIpFailed()" call in the "newEndPoint"
conditional (about line 552) of "cxnConnect()" also, but I would suspect so.

My suggestion:  Add a "hostIpFailed(cxn->myHost);" statement to the "then"
clauses of the conditionals at lines 519, 529, and 552 of
"innfeed/connection.c".  The conditional at line 541 already has it in its
"then" clause.

What does my suggestion do:  It makes innfeed try the next address available
upon ANY failure to establish a connection (other than "no addresses
available" [line 512] or "connection in bad state" [line 491]).  Without the
suggestion, it looks as if at least two types of failures will be repeated
with the SAME address forever.

Re: Regarding INN - name to address resolution for peers
#78650
Author: Russ Allbery
Date: Tue, 05 Feb 2008 23:22
38 lines
3105 bytes
"D. Stussy" <spam@bde-arc.ampr.org> writes:

> HOWEVER, in "cxnConnect()", we don't seem to rotate through the
> addresses where there is a "can't create socket" or a "can't set socket
> non-blocking" error by calling "hostIpFailed(cxn->myHost)" and I think
> we need to - else we repeatedly try the same AF+address that failed the
> last time - in a virtual infinite loop if it never succeeds (such as
> trying an IPv6 address returned by the resolver on an IPv4-only kerneled
> host).

You're right, this code should use a non-blocking version of
network_connect rather than reinventing the wheel.  network_connect does
the right thing with failure to create sockets for a particular AF.

I could have sworn I already wrote a non-blocking network_connect based on
this code for some other project, but perhaps not.

> I don't know if we need the "hostIpFailed()" call in the "newEndPoint"
> conditional (about line 552) of "cxnConnect()" also, but I would suspect
> so.

I doubt it.  Look at what newEndPoint does.  It's not related to the
remote address.

> My suggestion:  Add a "hostIpFailed(cxn->myHost);" statement to the
> "then" clauses of the conditionals at lines 519, 529, and 552 of
> "innfeed/connection.c".  The conditional at line 541 already has it in
> its "then" clause.

I agree only with line 519 (the failure to create the socket).  I've made
that change in CURRENT.  It doesn't make sense to me to do this for local
failures such as setting a socket non-blocking.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Regarding INN - name to address resolution for peers
#78651
Author: D. Stussy
Date: Wed, 06 Feb 2008 02:27
27 lines
2951 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:87lk5zrntp.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
> > My suggestion:  Add a "hostIpFailed(cxn->myHost);" statement to the
> > "then" clauses of the conditionals at lines 519, 529, and 552 of
> > "innfeed/connection.c".  The conditional at line 541 already has it in
> > its "then" clause.
>
> I agree only with line 519 (the failure to create the socket).  I've made
> that change in CURRENT.  It doesn't make sense to me to do this for local
> failures such as setting a socket non-blocking.

I can agree with that IF those 2 conditionals at line 529 and 552 won't
cause an infinite indefinent postponement from repeated failures.  However,
I'm not versed enough in the details of network sockets to be able to tell
this (for 529), and you're correct that line 552's conditional may not
depend on the network - but if it can't fail for some connections in a way
where it won't also fail for others, then I can concede this one.  However,
for 529, "blocking vs. non-blocking" sockets are dependent on AF type, so
there may be a case where some address works while another fails, yet
without this, it could lock in a failing infinite loop?  What would happen
if some future (or unexpected) AF type has blocking-only sockets?

I'm not signed up for the INN working group or bug lists, but you have my
permission to copy my posts over there and discuss my points.

Re: Regarding INN - name to address resolution for peers
#78652
Author: Russ Allbery
Date: Wed, 06 Feb 2008 03:45
18 lines
2048 bytes
"D. Stussy" <spam@bde-arc.ampr.org> writes:

> However, for 529, "blocking vs. non-blocking" sockets are dependent on
> AF type,

I'm pretty sure that they're not.

> What would happen if some future (or unexpected) AF type has
> blocking-only sockets?

Blocking is not a property of the protocol.  It controls the behavior of
read and write in the kernel if there is no pending data.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Regarding INN - name to address resolution for peers
#78659
Author: D. Stussy
Date: Wed, 06 Feb 2008 22:36
22 lines
2394 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:87hcgmn3wz.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
>
> > However, for 529, "blocking vs. non-blocking" sockets are dependent on
> > AF type,
>
> I'm pretty sure that they're not.
>
> > What would happen if some future (or unexpected) AF type has
> > blocking-only sockets?
>
> Blocking is not a property of the protocol.  It controls the behavior of
> read and write in the kernel if there is no pending data.

That's what I thought - and as a "software switch," there should NEVER be a
failure, yet the conditional is there to take the worse case (kernel bug?),
so assuming that such a failure is possible, wouldn't the infinite re-trying
of the same address for this operation cause a virtual infinite loop without
trying other addresses/AFs?

Re: Regarding INN - name to address resolution for peers
#78660
Author: Russ Allbery
Date: Wed, 06 Feb 2008 22:39
20 lines
2519 bytes
"D. Stussy" <spam@bde-arc.ampr.org> writes:

> That's what I thought - and as a "software switch," there should NEVER
> be a failure, yet the conditional is there to take the worse case
> (kernel bug?), so assuming that such a failure is possible, wouldn't the
> infinite re-trying of the same address for this operation cause a
> virtual infinite loop without trying other addresses/AFs?

It's not an infinite loop since innfeed goes on to do other things and
just periodically retries opening the connection.  If setting the socket
to non-blocking is failing, I don't see how rotating the address will help
any.  It's either going to keep failing or stop failing for reasons
unrelated to the socket's address family, so it would make no difference
whether one rotated addresses or not.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Regarding INN - name to address resolution for peers
#78661
Author: D. Stussy
Date: Thu, 07 Feb 2008 01:27
31 lines
3263 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:87prv94slm.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
>
> > That's what I thought - and as a "software switch," there should NEVER
> > be a failure, yet the conditional is there to take the worse case
> > (kernel bug?), so assuming that such a failure is possible, wouldn't the
> > infinite re-trying of the same address for this operation cause a
> > virtual infinite loop without trying other addresses/AFs?
>
> It's not an infinite loop since innfeed goes on to do other things and
> just periodically retries opening the connection.  If setting the socket
> to non-blocking is failing, I don't see how rotating the address will help
> any.  It's either going to keep failing or stop failing for reasons
> unrelated to the socket's address family, so it would make no difference
> whether one rotated addresses or not.

It is a virtual infinite loop as far as that feed is concerned as it never
progresses (actually, an infinite indefinent postponement).  Changing the
address (hopefully to another AF) COULD HELP in that it finds one that
doesn't have the failure condition.

Rotating through the other addresses here means that if the change in
blocking status fails the connection, it is because it has failed for ALL of
the addresses, while not doing so means that the feed will get stuck should
it fail on ANY of the addresses (when it hits the address that causes
failure) - where there could be another address that works that may never be
used (thereafter).  It's more robust and resilient - just what's needed for
error recovery.

Re: Regarding INN - name to address resolution for peers
#78662
Author: Russ Allbery
Date: Thu, 07 Feb 2008 01:39
28 lines
2884 bytes
"D. Stussy" <spam@bde-arc.ampr.org> writes:
> "Russ Allbery" <rra@stanford.edu> wrote:

>> It's not an infinite loop since innfeed goes on to do other things and
>> just periodically retries opening the connection.  If setting the
>> socket to non-blocking is failing, I don't see how rotating the address
>> will help any.  It's either going to keep failing or stop failing for
>> reasons unrelated to the socket's address family, so it would make no
>> difference whether one rotated addresses or not.

> It is a virtual infinite loop as far as that feed is concerned as it
> never progresses (actually, an infinite indefinent postponement).

Until whatever issue that causes the socket to not be set non-blocking
clears, at which point it will then use the first and preferred address
instead of some other random address later in the return from getaddrinfo,
which seems to be to be superior behavior.

> Changing the address (hopefully to another AF) COULD HELP in that it
> finds one that doesn't have the failure condition.

I don't see any way in which this is possible.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Regarding INN - name to address resolution for peers
#78663
Author: D. Stussy
Date: Thu, 07 Feb 2008 02:55
35 lines
3452 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:878x1x1r5s.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
> > It is a virtual infinite loop as far as that feed is concerned as it
> > never progresses (actually, an infinite indefinent postponement).
>
> Until whatever issue that causes the socket to not be set non-blocking
> clears, at which point it will then use the first and preferred address
> instead of some other random address later in the return from getaddrinfo,
> which seems to be to be superior behavior.
>
> > Changing the address (hopefully to another AF) COULD HELP in that it
> > finds one that doesn't have the failure condition.
>
> I don't see any way in which this is possible.

Well, technically, setting a socket's blocking status should never fail yet
the code accounts for that possibility.  Error handling isn't about what
should happen - but about what shouldn't.  You're making an assumption that
this error could and will eventually clear, while I assume that it never may
(e.g. software bug).

Changing the status is an external call.  No one can guarentee that such an
IOCTL-type call is address or address family independent in all contexts
across all platforms.  Although I agree that it is likely to be, one cannot
universally make that assumption - because one doesn't have control of the
coding outside of one's own program.  Regardless, you may feel that trying
other addresses & AFs (if available) is unnecessary, but what is the harm in
doing so?  I see none, yet I also see an advantage in trying them over not.

I believe we're at a deadlock.  That's why I suggested posting this to the
appropriate INN mailing lists - since no one else has given their opinion
here....

Re: Regarding INN - name to address resolution for peers
#78677
Author: Julien ÉLIE
Date: Fri, 08 Feb 2008 14:05
29 lines
2864 bytes
Hi D. Stussy,

>> I don't see any way in which this is possible.
>
> Well, technically, setting a socket's blocking status should never fail yet
> the code accounts for that possibility.

What is the problem if the code accounts for a possibility which never happens?
What would you have written yourself instead of this code?


> I believe we're at a deadlock.  That's why I suggested posting this to the
> appropriate INN mailing lists - since no one else has given their opinion
> here....

I do not think it will change something since active participants in
inn-workers {-a-t-} isc.org also read this newsgroup.
But if you want to post there, feel free to post!  It is open.

(My not having enough knowledge to be of any help on that issue is the reason
why I do not participate in this thread.)

-- 
Julien ÉLIE

« -- Tu dois avoir un messager zélé autant qu'ailé
  pour faire rapidement le trajet.
  -- Oui ! et c'est une fine mouche ! » (Astérix)
Re: Regarding INN - name to address resolution for peers
#78686
Author: D. Stussy
Date: Fri, 08 Feb 2008 21:42
43 lines
3540 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:fohnj8$7ub$1@news.trigofacile.com...
> Hi D. Stussy,
>
> >> I don't see any way in which this is possible.
> >
> > Well, technically, setting a socket's blocking status should never fail
yet
> > the code accounts for that possibility.
>
> What is the problem if the code accounts for a possibility which never
happens?
> What would you have written yourself instead of this code?

If it were my choice, I would have added the extra line to rotate through
the addresses upon this failure too.  Although Russ is logical in his
reason, that reason cannot be universally proven - while my reason assumes
that it can be disproven for some case.  There is no harm in adding the
code.  It may take modern processors an additional microsecond to make the
function call and return (if that) - but compared to the fact that the feed
is then put to sleep for x seconds to try later, it's deminimus and doesn't
delay the code.  Might it be unnecessary?  I shall concede the possibility.
However, I still think it's better error handing to account for the
possibility instead of remaining blind to it.

> > I believe we're at a deadlock.  That's why I suggested posting this to
the
> > appropriate INN mailing lists - since no one else has given their
opinion
> > here....
>
> I do not think it will change something since active participants in
> inn-workers {-a-t-} isc.org also read this newsgroup.
> But if you want to post there, feel free to post!  It is open.
>
> (My not having enough knowledge to be of any help on that issue is the
reason
> why I do not participate in this thread.)

Considering that, until now, no one else had commented on this thread, I
couldn't assume that either....

Re: Regarding INN - name to address resolution for peers
#78687
Author: Russ Allbery
Date: Fri, 08 Feb 2008 21:46
31 lines
3261 bytes
"D. Stussy" <spam@bde-arc.ampr.org> writes:

> If it were my choice, I would have added the extra line to rotate
> through the addresses upon this failure too.  Although Russ is logical
> in his reason, that reason cannot be universally proven - while my
> reason assumes that it can be disproven for some case.  There is no harm
> in adding the code.  It may take modern processors an additional
> microsecond to make the function call and return (if that) - but
> compared to the fact that the feed is then put to sleep for x seconds to
> try later, it's deminimus and doesn't delay the code.

The reason why I disagree with this change has nothing to do with
performance.  Rather, the first address returned by getaddrinfo is
*preferred*; that sorting is often done on the basis of latency and other
considerations by the resolver.  Hence, I don't want to discard that
preference information due to an error that is unrelated to the address
being attempted.

If there is a transient resource exhaustion that prevents setting a socket
to non-blocking that later resolves, I think it's better to return to the
preferred address instead of one of the later addresses.

It's really a pedantic point since this error condition is exceedingly
unlikely, but I don't want to rotate addresses when there isn't a reason
to do so.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Regarding INN - name to address resolution for peers
#78689
Author: D. Stussy
Date: Sat, 09 Feb 2008 05:18
53 lines
4766 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:87tzkj15qe.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
>
> > If it were my choice, I would have added the extra line to rotate
> > through the addresses upon this failure too.  Although Russ is logical
> > in his reason, that reason cannot be universally proven - while my
> > reason assumes that it can be disproven for some case.  There is no harm
> > in adding the code.  It may take modern processors an additional
> > microsecond to make the function call and return (if that) - but
> > compared to the fact that the feed is then put to sleep for x seconds to
> > try later, it's deminimus and doesn't delay the code.
>
> The reason why I disagree with this change has nothing to do with
> performance.  Rather, the first address returned by getaddrinfo is
> *preferred*; that sorting is often done on the basis of latency and other
> considerations by the resolver.  Hence, I don't want to discard that
> preference information due to an error that is unrelated to the address
> being attempted.

And that's where we differ.  Depending on HOW it's implemented, it could be
related to the address - if the setting is implemented in the address
family's driver/module instead of some AF-independent code.  In this latter
case, it could succeed for some address and fail (potentially forever, if
due to a bug) for some other.  Only by trying different addresses does one
escape this situation to find an[other] address that works (assuming one is
available).

I don't see where trying a second or subsequent address would discard prior
statistics that the program has gathered to express an ordering preference
to the getaddrinfo() call.  Any such preference designation is external to
the call and maintained by innfeed itself, and if there are prior
statistics, then that means that the failure this time is most likely
transitory, not permanent - but if another address is functional, then maybe
it is the better choice. The manual page for getaddrinfo() does not indicate
(nor does RFC 2553) that it orders the addresses returned in any manner
other than by parameters given by the calling routine.  If innfeed is
discarding preference information, it does so by its design - and I don't
see how simply trying an alternate address would cause that.

> If there is a transient resource exhaustion that prevents setting a socket
> to non-blocking that later resolves, I think it's better to return to the
> preferred address instead of one of the later addresses.
>
> It's really a pedantic point since this error condition is exceedingly
> unlikely, but I don't want to rotate addresses when there isn't a reason
> to do so.

Your reason to do so is to find and use one that works, not to keep trying
one that may be a problem forever.  The call shouldn't fail, but if it does,
all we know is that it has, not why it has.

Re: Regarding INN - name to address resolution for peers
#78690
Author: Russ Allbery
Date: Sat, 09 Feb 2008 05:30
26 lines
2857 bytes
"D. Stussy" <spam@bde-arc.ampr.org> writes:

> I don't see where trying a second or subsequent address would discard
> prior statistics that the program has gathered to express an ordering
> preference to the getaddrinfo() call.

No, that's not what I'm talking about.  I'm talking about the ordering
returned by the resolver, not something maintained in INN (which is not
where it really belongs, IMO).  Address ordering for hosts with multiple A
records is used fairly widely for preference ranking and is implemented by
many resolver clients.

> The manual page for getaddrinfo() does not indicate (nor does RFC 2553)
> that it orders the addresses returned in any manner other than by
> parameters given by the calling routine.

See RFC 3484 and /etc/gai.conf on a Linux system.

Anyway, I will not be making this change.  I think it's wrong.  You can
try to convince another INN committer to do so, I suppose.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Regarding INN - name to address resolution for peers
#78692
Author: D. Stussy
Date: Sat, 09 Feb 2008 05:58
35 lines
3484 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:874pcig0hq.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
>
> > I don't see where trying a second or subsequent address would discard
> > prior statistics that the program has gathered to express an ordering
> > preference to the getaddrinfo() call.
>
> No, that's not what I'm talking about.  I'm talking about the ordering
> returned by the resolver, not something maintained in INN (which is not
> where it really belongs, IMO).  Address ordering for hosts with multiple A
> records is used fairly widely for preference ranking and is implemented by
> many resolver clients.

Only on systems that have that enabled as an option (another assumption),
and again, if there's "anything" wrong with the top address, why then not
try the others?  It's better to try another address that may complete than
to sit-and-spin on one that won't.  The worst case is that ALL addresses
fail, as opposed to just one.

> > The manual page for getaddrinfo() does not indicate (nor does RFC 2553)
> > that it orders the addresses returned in any manner other than by
> > parameters given by the calling routine.
>
> See RFC 3484 and /etc/gai.conf on a Linux system.
>
> Anyway, I will not be making this change.  I think it's wrong.  You can
> try to convince another INN committer to do so, I suppose.

Your choice, but if this does result in a bug report in the future, then
don't say I didn't warn you....  You're making an assumption that the
setting of this function is not address (or address family) dependent -- 
where I say you have no basis for that conclusion.

Re: Regarding INN - name to address resolution for peers
#78693
Author: Russ Allbery
Date: Sat, 09 Feb 2008 06:55
34 lines
3187 bytes
"D. Stussy" <spam@bde-arc.ampr.org> writes:
> "Russ Allbery" <rra@stanford.edu> wrote:

>> No, that's not what I'm talking about.  I'm talking about the ordering
>> returned by the resolver, not something maintained in INN (which is not
>> where it really belongs, IMO).  Address ordering for hosts with
>> multiple A records is used fairly widely for preference ranking and is
>> implemented by many resolver clients.

> Only on systems that have that enabled as an option (another
> assumption),

No, this does *not* only happen on systems where it is enabled by an
option.  Either the resolver returns the records in the order returned by
the remote DNS server, which *is* sometimes significant (if unreliable),
or it applies a local sorting algorithm (such as all glibc Linux systems).

Again, *please* go read RFC 3484.  Note, for example, the second paragraph
of the abstract:

   All IPv6 nodes, including both hosts and routers, must implement
   default address selection as defined in this specification.

and section 2:

   As a consequence, we intend that implementations of getaddrinfo()
   will use the destination address selection algorithm specified here
   to sort the list of IPv6 and IPv4 addresses that they return.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads