Comment 8 for bug 824797

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 824797] Re: bzr serve doesn't drop idle/dead connections

On 16 September 2011 08:13, John Arbash Meinel <email address hidden> wrote:
>> If the remote end closes while select is waiting I think you are
>> guaranteed to get that behaviour - select will return communicating
>> "you can read" and then what you actually read is an EOF.
>
> Right, it is even documented as such.
>
> What errors could we get, so I can write a test case for it?

The most obvious would be ECONNRESET indicating a network problem,
though this might be a bit hard to actually produce from a test suite,
since it's normally from below the application layer. Possibly EBADF
when the local end of the socket is closed would come through there.

> It seems that it is happening after we start select.select() and then
> the *local* socket is getting closed by the test suite teardown code.
> After which, select doesn't trigger 'closed'. If you run select again,
> you actually get EBADF.