[Popcon-developers] Bug#350934: popularity-contest: HTTP method fails to recognize success

Javier Kohen jkohen at users.sourceforge.net
Fri Apr 7 13:08:48 UTC 2006


Hello Bill,

El vie, 07-04-2006 a las 14:29 +0200, Bill Allombert escribió:
> On Thu, Apr 06, 2006 at 11:45:05PM -0300, Javier Kohen wrote:
> > Hello Bill
> > 
> > El vie, 07-04-2006 a las 00:54 +0200, Bill Allombert escribió:
> > > > Popcon-upload fails to recognize a successful upload. The popcon web server replies within 2 seconds with the following banner, still popcon ends up aborting with a timeout after 30 seconds:
> > > > 
> > > > 
> > > > HTTP/1.1 200 OK
> > > > Transfer-Encoding: chunked
> > > > Date: Wed, 01 Feb 2006 19:59:48 GMT
> > > > Content-Type: text/plain; charset=utf-8
> > > > Server: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-16 DAV/1.0.3
> > > > 
> > > > 27 
> > > > Compressed (x-gzip) encoding detected.
> > > > 
> > > > 54 
> > > > Thanks for your submission to Debian Popularity-Contest!
> > > > DEBIAN POPCON HTTP-POST OK
> > > > 
> > > > 0
> > > > 
> > > > 
> > > > Running popcon-upload with the -d switch doesn't give any useful output at all, as it never reaches the line where the content is matched against the "DEBIAN POPCON HTTP-POST OK" pattern.
> > > > 
> > > 
> > > Hello Javier,
> > > 
> > > It seems popcon-upload will timeout after 30 seconds when the script to
> > > send the data, so if your connection is slow it might take more than 30
> > > seconds to complete, and the timeout will occur.
> > 
> > My connection is definitely not slow. In fact, if you read my original
> > report, the server is reporting having received all data after *2
> > seconds*. Moreover, I have a fair amount of packages and popcon sends
> > less than 16kB of data; even at 9600bps there is plenty of time to send
> > it.
> 
> Hello Javier,
> 
> Could you try
> 
> time /usr/share/popularity-contest/popcon-upload < /var/log/popularity-contest && echo $?
> 
> Here I get
> time /usr/share/popularity-contest/popcon-upload < /var/log/popularity-contest;echo $?
> /usr/share/popularity-contest/popcon-upload < /var/log/popularity-contest  1,79s user 0,08s system 9% cpu 20,398 total
> 0
> 
> Note the 0 that means success.

Here I get:
$ time /usr/share/popularity-contest/popcon-upload
< /var/log/popularity-contest && echo $?
timeout in popcon-upload

real    0m30.216s
user    0m0.060s
sys     0m0.030s

Note that that is *exactly* what I reported originally.

> > I don't want to appear ungrateful, but I would certainly appreciate it
> > if you had actually read my original report. Don't hesitate to ask me
> > any questions you might have.
> 
> There is no contradiction with what you wrote: on my box we get the
> reply in about 2 seconds but the script take actually 20 seconds to 
> complete. If it tooks 30 seconds, the timeout might be a problem.

Well, my connection is certainly not slow: 2.5Mbps upstream, 256kbps
downstream. (I know it's not *that* great, but it could get much worse).

> Since I cannot reproduce the problem I have to rely on guesswork.
> 
> I hope Petter can investigate. 
> 
> I think the problem is that the client side rely does not parse the
> banner to detect the end but instead rely on the socket to be closed,
> and this happen too late. 

I think that you were relying on an unsound signal. You can't detect a
TCP/IP socket being closed without writing to it, which you don't seem
to once you're done sending the popularity data.

> Could you try the attached popcon-upload script ? This one will
> terminate as soon as it receive the "DEBIAN POPCON HTTP-POST OK"
> string instead of waiting for the socket to be closed. This way

This sounds like a fix. As a matter of fact, I get the following:
$ time ./popcon-upload-test < /var/log/popularity-contest && echo $?

real    0m6.319s
user    0m0.070s
sys     0m0.020s
0

and less than 2s real in following runs.

Thanks a lot for your support,
-- 
Javier Kohen <jkohen at users.sourceforge.net>
ICQ: blashyrkh #2361802
Jabber: jkohen at jabber.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada
	digitalmente
Url : http://lists.alioth.debian.org/pipermail/popcon-developers/attachments/20060407/0403e7e5/attachment.pgp


More information about the Popcon-developers mailing list