[MERGE] Fix infinite busy-loop caused by connection loss during read of response body in HPSS v1 and v2.

Martin Pool mbp at canonical.com
Wed Jun 11 12:58:50 BST 2008


On Wed, Jun 11, 2008 at 9:42 PM, Andrew Bennetts <andrew at canonical.com> wrote:
>> To be a bit pedantic, this is not really "connection reset" (ie
>> ECONNRESET), but rather "unexpected end of stream" or "connection closed
>> unexpectedly".  We may never want to handle them differently
>> programmatically but it's good to at least be precise to the user to
>> help debugging.
>
> The error string the user will see in this case is "Connection closed:
> Connection lost while reading response body. "
>
> The exception class itself probably could have a better name, though.  It's used
> for both failure to establish a connection, and interrupted connections.  Do you
> think we should split those?  I think that probably makes sense.  Twisted makes
> a distinction between "connection lost" and "connection failed", which seems
> right to me.  If you agree I'll followup with a change to replace
> ConnectionReset with ConnectionLost and ConnectionFailed (maybe keeping
> ConnectionReset as a common base class?).

Well, in typical tcp usage

  failed -> I tried to connect and got could not (maybe ECONNREFUSED);
ie the initial act of connecting failed
  reset -> I got a packet with RST set, ie ECONNRESET, as in the
recent case of gnome.org's firewall assassinating some http
connections
  lost -> i know i left it here somewhere :-)

If there is going to be a base class I'd suggest a genuinely generic
name like ConnectionError.

I think the main programmatic distinction would be whether the error
occurred at startup or later, and even then I can't think of a really
clear case where it would affect our behaviour.  As long as we save
the message (maybe even the object or errno?) from the underlying
exception it will be enough.  My point was not to inadvertently sound
more specific than is justified.

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list