[MERGE][#246233] Allow ConnectionReset to propagate from read_mergeable_from_url.

John Arbash Meinel john at arbash-meinel.com
Fri Sep 12 03:53:05 BST 2008


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

Andrew Bennetts wrote:
> This small change fixes one of the remaining causes of TooManyConcurrentRequests
> errors.  "bzr pull" and "bzr merge" both first try opening the URL as a bundle
> via read_mergeable_from_url, but if the connection failed that function was
> raising NotABundle instead of propagating the ConnectionReset.
> 
> This fix is a two-liner (catch ConnectionReset explicitly and re-raise it), and
> I've included a test which unfortunately is a bit longer, but still quite
> simple.
> 
> Perhaps a deeper fix would be to re-examine our exception hierarchy;
> maybe ConnectionReset should not subclass TransportError.  It's also not
> immediately obvious why read_mergeable_from_url catches TransportError — I'm
> guessing that's what “transport.get('directory-name')” usually raises?  A
> comment is probably warranted.  But instead of letting the perfect be the enemy
> of the good, I'm submitting a simple and clearly correct patch.

I believe it is to handle the suite of errors like NoSuchFile or
NotDirectory. Also lots of things like FTP and SFTP don't give very good
errors when you try to read from a directory. And those generally get
turned into generic TransportErrors.

ConnectionReset could be considered a different category of error, but I
think what you've done works well.

John
=:->

BB:approve

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

iEYEARECAAYFAkjJ2ZEACgkQJdeBCYSNAAN+RQCgu4W2i76/K18W8N20LO3Hz5KJ
pDUAnRMZTQEuTcCErKzmMECoxYl80IQT
=ASVv
-----END PGP SIGNATURE-----



More information about the bazaar mailing list