Do you need to close a branch? (if so how)

Vincent Ladeuil v.ladeuil+lp at free.fr
Wed Feb 25 10:33:00 GMT 2009


>>>>> "Nicholas" == Nicholas Allen <nick.allen at onlinehome.de> writes:

    >> 
    >> Looks fine to me. Its a bit odd that you need to manually del the
    >> variable; is this perhaps in the main loop of your daemon, rather than a
    >> helper function?

    Nicholas> Yes it is a bit odd. Actually this change made no difference either.
    Nicholas> Bazaar seems to be leaking a socket for every pull from the parent
    Nicholas> branch (even after deleting the parent branch).

    Nicholas> Perhaps this issue hasn't shown up before because
    Nicholas> bzr pull is always run as a process that exits
    Nicholas> after one pull so the kernel will clean up the
    Nicholas> sockets for you?

You forget about the test suite which does many connections to
internal test servers. And we have some tests "leaking" sockets
because they get garbage collected *after* the tests ends, but
still garbage collected.

You may encounter some variation of the problem but it's hard to
tell without a high level description of what your code is doing.

Are you polling the branches ? 

If that's the case, you may want to look at the
possible_transports parameter in Branch.open.

    Nicholas> It manages to bring my server to its knees in less
    Nicholas> than 15 minutes though so it's quite annoying!

    Nicholas> Any idea what this could be?

As Robert said, there should some objects accumulating
somewhere.Specifically that's transport objects you're looking
after here, more than branches that hold references to some
transport.

Have you tried some 'lsof -p <pid>' while your code is running ?

     Vincent



More information about the bazaar mailing list