AW: AW: AW: AW: bzr selftest (on solaris 10): too may open files

John Arbash Meinel john at arbash-meinel.com
Wed Nov 19 16:29:31 GMT 2008


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


...

> *and* this is also true with python-2.5.2.
> 
> Interrupting the selftest and using pfiles <pid> reveals that in
> fact the open files are sockets...
> 
> I have yet to understand why this happens on Solaris and not on
> Linux but it means that only selftest is concerned by the problem
> and not should not have consequences when using bzr itself.
> 
> I'll run the test suite by parts to check which tests are really
> failing and keep you informed, but the important result is that
> you should be safe using bzr.
> 
>      Vincent
> 
> 

I would guess that this is the "spawned threads" not getting cleaned up
quickly. (Run the test suite on other platforms and it will tell you
that we leaked XX threads.)
This is generally caused by any Remote test, because it spawns a smart
server in the second thread, which waits on a socket to respond to user
requests. And as we don't have an explicit "close()" for remote
connections, the service tends to stay around for a while.

So one possible fix would be to add a timeout to the socket, and if
there hasn't been a request for XX seconds, go ahead and shutdown
cleanly. Also we can have the test suite itself notice that the test has
finished and poke at the thread to tell it to shut down.

As I understand it, this causes problems on Windows because you can't
mix a socket with a timeout with the file-like wrappers on a socket.
Also, adding a "timeout" on a socket on windows is actually just setting
O_NDELAY which will raise an exception if the socket request *would
have* blocked.

This may just be a good case for having a "if sys.platform == 'win32':"
and normally adding a timeout and a signal to allow the test suite to
shutdown the extra threads, and on Windows that just doesn't happen.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkkPuoACgkQJdeBCYSNAAOEDgCdFTjmPBTiju9R28/pWJi8grPL
racAoIitBGuPra1eK70yWQaDkNWJzQwC
=mRyo
-----END PGP SIGNATURE-----



More information about the bazaar mailing list