Comment 2 for bug 531580

Revision history for this message
Andrew Bennetts (spiv) wrote :

Looking at the code, it seems very clear that it's failing to handle connection reset errors while reading. In general it appears that bzrlitb.transport.http.response.RangeFile's read method doesn't handle any errors that might arise while reading from self._file. Alternatively bzrlib.transport.http.HttpTransportBase's _readv method could handle socket errors while doing rfile.read.

When reading from sockets, bzrlib.smart.medium catches socket.error and checks for e.errno in (errno.ECONNRESET, errno.WSAECONNRESET) [with care to cope if WSAECONNRESET isn't defined on this platform]. I think bzrlib.transport.http should do the same, and presumably raise bzrlib.errors.ConnectionReset when this happens.