gtk-gnutella-devel Digest, Vol 29, Issue 2

View: New views
1 Messages — Rating Filter:   Alert me  

gtk-gnutella-devel Digest, Vol 29, Issue 2

by gtk-gnutella-devel-request :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Send gtk-gnutella-devel mailing list submissions to
        gtk-gnutella-devel@...

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel
or, via email, send a message with subject or body 'help' to
        gtk-gnutella-devel-request@...

You can reach the person managing the list at
        gtk-gnutella-devel-owner@...

When replying, please edit your Subject line so it is more specific
than "Re: Contents of gtk-gnutella-devel digest..."


Today's Topics:

   1.  Too many downloads (Lloyd Bryant)
   2. Re:  Too many downloads (Raphael Manfredi)
   3.  getpeername() failed warning: getpeername not being called.
      (Matthew Lye)
   4. Re:  getpeername() failed warning: getpeername not being
      called. (Christian Biere)
   5. Re:  getpeername() failed warning: getpeername not being
      called. (Christian Biere)
   6. Re:  getpeername() failed warning: getpeername not being
      called. (Matthew Lye)
   7. Re:  getpeername() failed warning: getpeername not being
      called. (Christian Biere)
   8. Re:  getpeername() failed warning: getpeername not being
      called. (Christian Biere)


----------------------------------------------------------------------

Message: 1
Date: Sun, 10 May 2009 02:36:38 -0700
From: Lloyd Bryant <lloydbaz@...>
Subject: [gtk-gnutella-devel] Too many downloads
To: devlist <gtk-gnutella-devel@...>
Message-ID: <BAY121-W6D6954709A93DC1FEDC6FCE620@...>
Content-Type: text/plain; charset="iso-8859-1"


I recently encountered the following situation:  I have my max simultaneous downloads per file set to 30, and the max total downloads set to 120.  I started the download of a file with a large number of sources ( > 3000 ).  I left it alone for a few minutes, and when I came back, I had 17 active downloads, and 103 actively queued sources.  Meanwhile, a THEX download for this file couldn't even start, because I had reached the max total downloads.

I traced this issue back to the following change:
------------------------------------------------------------------------
r16537 | rmanfredi | 2009-04-21 09:18:21 -0700 (Tue, 21 Apr 2009) | 4 lines

download_has_enough_active_sources(): use fi->recvcount, not fi->lifecount as
the latter refers to all the known sources, not necessarily the ones that
end-up being active.

------------------------------------------------------------------------

What's happening is that actively queued sources do not count against "fi->recvcount" (they're in "fi->active_queued"), but they *do* count against the max total downloads.

I've changed that line in download_has_enough_active_sources() to use "(fi->recvcount + fi->active_queued)", rather than just "fi->recvcount", and this mitigates the issue considerably.  But I'm still seeing active plus actively queued exceeding the max simultaneous downloads per file value, since with the above change the only thing limiting the number of attempted connection is the max total downloads, and potentially every attempt can wind up as active or actively queued.

Lloyd B.

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 2
Date: Sun, 10 May 2009 17:40:33 +0000 (UTC)
From: Raphael_Manfredi@... (Raphael Manfredi)
Subject: Re: [gtk-gnutella-devel] Too many downloads
To: gtk-gnutella-devel@...
Message-ID: <gu73ih$hup$1@...>
Content-Type: text/plain; charset="iso-8859-1"

Quoting Lloyd Bryant <lloydbaz@...> from ml.softs.gtk-gnutella.devel:
:I've changed that line in download_has_enough_active_sources() to use
:"(fi->recvcount + fi->active_queued)", rather than just "fi->recvcount"

Thanks, I've committed that change.


:But I'm still seeing active plus actively
:queued exceeding the max simultaneous downloads per file value, since with the
:above change the only thing limiting the number of attempted connection is the
:max total downloads, and potentially every attempt can wind up as active or
:actively queued.

The max number of downloads per file should only be a hint, not something
strictly enforced.  The aim is to avoid using too many sources for a given
file, but this is not something that prevents particular abuse of some
resource, be it local (# of connections tracked separately) or remote (max #
of downloads per host is enforced).

Raphael



------------------------------

Message: 3
Date: Tue, 12 May 2009 22:34:11 -0400
From: Matthew Lye <mlye@...>
Subject: [gtk-gnutella-devel] getpeername() failed warning:
        getpeername not being called.
To: gtk-gnutella-devel@...
Message-ID: <4DD11138-2588-47D6-A3A8-9A476A99EFBE@...>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

This may be old news.

For a long time I've seen the following warning produced many, many  
times per session:

> 09-05-12 22:01:00 (WARNING): getpeername() failed: Invalid argument

I just got around to checking into it with dtrace, and it appears that  
getpeername() is not actually being called when this warning comes up.

This would imply that the either of the two following asserts in the  
function socket_addr_getpeername(...) (located in core/sockets.c: line  
1981) always fails:
> g_return_val_if_fail(p_addr, -1);
> g_return_val_if_fail(fd >= 0, -1);


(Otherwise, a getpeername() call would be logged.)






------------------------------

Message: 4
Date: Wed, 13 May 2009 05:26:18 +0200
From: Christian Biere <christianbiere@...>
Subject: Re: [gtk-gnutella-devel] getpeername() failed warning:
        getpeername not being called.
To: gtk-gnutella-devel@...
Message-ID: <20090513032618.GB692@...>
Content-Type: text/plain; charset=utf-8

Matthew Lye wrote:

> For a long time I've seen the following warning produced many, many  
> times per session:
>
> > 09-05-12 22:01:00 (WARNING): getpeername() failed: Invalid argument
>
> I just got around to checking into it with dtrace, and it appears that  
> getpeername() is not actually being called when this warning comes up.
>
> This would imply that the either of the two following asserts in the  
> function socket_addr_getpeername(...) (located in core/sockets.c: line  
> 1981) always fails:
> > g_return_val_if_fail(p_addr, -1);
> > g_return_val_if_fail(fd >= 0, -1);

If that's the case you should see the relevant warnings on stderr.
You can also try to remove the lines to verify your thesis.

It is also possible that the userland code of getpeername() doesn't
like some of the passed arguments, so that the syscall is never
issued and you probably don't see anything with dtrace. If it
happens often but not always it could be an alignment issue.

--
Christian



------------------------------

Message: 5
Date: Wed, 13 May 2009 05:31:19 +0200
From: Christian Biere <christianbiere@...>
Subject: Re: [gtk-gnutella-devel] getpeername() failed warning:
        getpeername not being called.
To: gtk-gnutella-devel@...
Message-ID: <20090513033119.GC692@...>
Content-Type: text/plain; charset=utf-8

Christian Biere wrote:

> Matthew Lye wrote:
> > For a long time I've seen the following warning produced many, many  
> > times per session:
> >
> > > 09-05-12 22:01:00 (WARNING): getpeername() failed: Invalid argument
> >
> > I just got around to checking into it with dtrace, and it appears that  
> > getpeername() is not actually being called when this warning comes up.
> >
> > This would imply that the either of the two following asserts in the  
> > function socket_addr_getpeername(...) (located in core/sockets.c: line  
> > 1981) always fails:
> > > g_return_val_if_fail(p_addr, -1);
> > > g_return_val_if_fail(fd >= 0, -1);
>
> If that's the case you should see the relevant warnings on stderr.
> You can also try to remove the lines to verify your thesis.
>
> It is also possible that the userland code of getpeername() doesn't
> like some of the passed arguments, so that the syscall is never
> issued and you probably don't see anything with dtrace. If it
> happens often but not always it could be an alignment issue.

It's also thinkable that the connection was only half-established
or reset before getpeername(). You might want to run tcpdump or
similar in parallel to see whether the warnings correlate with
incoming connections and what happens after the first SYN packet.

--
Christian



------------------------------

Message: 6
Date: Wed, 13 May 2009 00:53:58 -0400
From: Matthew Lye <mlye@...>
Subject: Re: [gtk-gnutella-devel] getpeername() failed warning:
        getpeername not being called.
To: gtk-gnutella-devel@...
Message-ID: <43935FEC-0457-4D0A-83BD-694481A97306@...>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

On 12-May-09, at 11:26 PM, Christian Biere wrote:
> If that's the case you should see the relevant warnings on stderr.
> You can also try to remove the lines to verify your thesis.

No, no, that would have been clever.

It's more complicated than I thought. There's a "getpeername
$UNIX2003()", which is being called instead of "getpeername()", and it  
is this which fails.  Presumably known to everyone outside of Apple as  
"getpeername()".  The arguments being passed it seem okay.  A socket  
number (I assume), and two addresses.  The latter should be a (small)  
size, and is in my tests always 0x10 or 0x1e.  I don't know the  
structure of the former, but it always starts with 0x1002 followed by  
3 8-byte words of zeros in the first case, and 0x1c1e followed by 6 8-
byte words of zeros in the second case.

The warnings didn't seem to correlate with anything unusual incoming  
bearing a SYN bit.  I'm less than handy with tcpdump, I'll try  
tomorrow with fewer peers in the mix.  Is there anything in particular  
you're thinking of?









------------------------------

Message: 7
Date: Wed, 13 May 2009 07:32:34 +0200
From: Christian Biere <christianbiere@...>
Subject: Re: [gtk-gnutella-devel] getpeername() failed warning:
        getpeername not being called.
To: gtk-gnutella-devel@...
Message-ID: <20090513053230.GA21209@...>
Content-Type: text/plain; charset=utf-8

Matthew Lye wrote:

> On 12-May-09, at 11:26 PM, Christian Biere wrote:
> > If that's the case you should see the relevant warnings on stderr.
> > You can also try to remove the lines to verify your thesis.
>
> No, no, that would have been clever.
>
> It's more complicated than I thought. There's a "getpeername
> $UNIX2003()", which is being called instead of "getpeername()", and it  
> is this which fails.  Presumably known to everyone outside of Apple as  
> "getpeername()".  The arguments being passed it seem okay.  A socket  
> number (I assume), and two addresses.  The latter should be a (small)  
> size, and is in my tests always 0x10 or 0x1e.  I don't know the  
> structure of the former, but it always starts with 0x1002 followed by  
> 3 8-byte words of zeros in the first case, and 0x1c1e followed by 6 8-
> byte words of zeros in the second case.
>
> The warnings didn't seem to correlate with anything unusual incoming  
> bearing a SYN bit.  I'm less than handy with tcpdump, I'll try  
> tomorrow with fewer peers in the mix.  Is there anything in particular  
> you're thinking of?

There must be some incoming connection, otherwise the function wouldn't
be called. accept() seems to succeed but doesn't fill in the source
address. Maybe dtrace could show anything useful about this accept()
call because it's already odd enough that it doesn't fill in the
source address.

It is possible that an incoming connection is reset before accept()
is called. Normally, accept() should fail in this case.

Another possibility is that there's an incoming IPv6 connection and
something with the code isn't right. I don't know whether you have
IPv6 connectivity or whether you've configured it to use IPv4 only.

--
Christian



------------------------------

Message: 8
Date: Wed, 13 May 2009 07:46:11 +0200
From: Christian Biere <christianbiere@...>
Subject: Re: [gtk-gnutella-devel] getpeername() failed warning:
        getpeername not being called.
To: gtk-gnutella-devel@...
Message-ID: <20090513054610.GB21209@...>
Content-Type: text/plain; charset=utf-8

Matthew Lye wrote:
> For a long time I've seen the following warning produced many, many  
> times per session:
>
> > 09-05-12 22:01:00 (WARNING): getpeername() failed: Invalid argument
>
> I just got around to checking into it with dtrace, and it appears that  
> getpeername() is not actually being called when this warning comes up.

Do you get this warning for every incoming connection or just for some?

--
Christian



------------------------------

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com

------------------------------

_______________________________________________
gtk-gnutella-devel mailing list
gtk-gnutella-devel@...
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel


End of gtk-gnutella-devel Digest, Vol 29, Issue 2
*************************************************