Hang at commit time when using sftp or bzr+ssh

Aaron Bentley aaron at aaronbentley.com
Fri Dec 9 15:24:16 UTC 2011


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

On 11-12-08 06:49 PM, Martin Packman wrote:
> On 08/12/2011, Aaron Bentley <aaron at aaronbentley.com> wrote:
>> 
>> Any time you're thinking about scopes and destructors, it's
>> worth considering using a ContextManager.  The transport itself
>> could implement __exit__()
> 
> Half the time it seems thinking about context manager means your
> code is already going down the wrong route.

Could you expand on that?

> In this case, it takes the problem of "doing this results in 9 ssh 
> connections that then hang around for a bit" and turns it into
> "doing this seems to work but is massively slow because it's
> repeatedly creating one ssh connection after another".
> 
> What seems to be needed instead of prompt cleanup is proper
> transport reuse.

I don't think they are mutually exclusive.  We do want to close
connections that are not in use.  Long-lived inactive connections can
be problematic for the server, and they have been so for Launchpad's
codehosting recently.

I did not mean that __exit__ would necessarily terminate the
connection.  We could just as easily implement a counter as we've done
with locks.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7iKB8ACgkQ0F+nu1YWqI0XBQCeJSYJghuHNs+ehWXHu+C2vGeR
9ZUAninxYSoxKVpPGDMyM49RXxM3V3Gk
=o4pv
-----END PGP SIGNATURE-----



More information about the bazaar mailing list