[MERGE][158972] Don't use timeout in HttpServer

John Arbash Meinel john at arbash-meinel.com
Thu Nov 1 18:08:04 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vincent Ladeuil wrote:
> We had a problem on Mac OS X since the first http test server
> implementation.
> 
> It turns out it's due to the fact that the python http test
> server we build upon use socket.makefile() internally and since
> http://docs.python.org/lib/socket-objects.html says timeout and
> makefile should not be mixed, we shouldn't.
> 
> Why didn't it break more obviously ? I don't know.
> 
> But this patch remove the timeout use and the test suite still
> pass, and, more importantly, webdav test suite is passing again :)
> 
> This does not address
> https://bugs.edge.launchpad.net/bzr/+bug/69978, it may make it
> more prone to occur, but testing under both Gutsy and OS X didn't
> triggered it.
> 
>           Vincent

I would actually rather avoid "makefile()" than settimeout. If we can't make
that work, then I'm okay with this.

- From what I remember, the main difference is that on Linux, it can block
waiting for the timeout, or issue EAGAIN.

But on Windows (and maybe Mac?) if it would block *at all*, then it raises an
exception. So basically settimeout sets "raise exception on blocking" and
doesn't actually do any timeout.
However, if it wouldn't actually block (there is already data in the pipe) then
you don't get a failure.

I guess with those tests, it just stresses it a bit more, and it is slightly
more likely that the consumer thread tries to read before the producer thread
gives it data.


The reason to have settimeout is because otherwise a bad test would cause the
pqm to hang, etc.

I think the Launchpad pqm has a watchdog running, that kills the commit if it
takes too long. Maybe we just need to do something like that?

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHKhYEJdeBCYSNAAMRAqUNAKC4iyB9VXJ1OV81ZaKadX/Z1CZs9wCgwUx0
C3KFqEWIVD/tOB5eGakE41Q=
=szkZ
-----END PGP SIGNATURE-----



More information about the bazaar mailing list