Paramiko throws EOFError rather than returning a 0 length file or ENOENT

Robert Collins robertc at robertcollins.net
Wed Sep 27 01:57:22 BST 2006


On Thu, 2006-09-14 at 09:34 +0200, Vincent Ladeuil wrote:
> 
> The protocol gives a clear definition, yes. Implementing that
> clear EOF indication detection is a bit more complex than it
> appears but I've made good progress on that front* and I'm
> confident we can achieve that.

Its a fairly straight forward statemachine: you are either reading the
header of a chunk, or a chunk body. You exit the machine when you read 0
as the length for a valid chunk. (IIRC).

>     Robert> You also have to be willing to resubmit the second
>     Robert> request if the server signals EOF or ERROR on the
>     Robert> first response by closing the connection. pipelining
>     Robert> of non idempotent requests is extremly tricky on
>     Robert> http. pipelining of range requests is possible but
>     Robert> prone to arbitrary delays when the
>     Robert> server/intermediaries decide to do a full object
>     Robert> response.
> 
> We don't do pipelining *yet*, to be precise, urllib2 don't, and
> in the implementation I propose neither do I. So we are safe on
> that side for now.
> 
> If we decide to do pipelining in the future, I think we can do so
> with a conservative approach by being overly restrictive on what
> we consider idempotent or not. And from there fine tune our
> choices for potential optimizations

Yup.

>     Robert> Persistent connections are an optional feature in
>     Robert> HTTP/1.0 and only spottily implemented.
> 
> Indeed, part of the tests I want to add is conformance to various
> levels of http protocol, again we can be conservative and just
> avoid persistent connections for 1.0 (as urllib2 already does
> even for 1.1...).
> 
> Also on that subject, I'd like to use the test suite against
> *real* servers and gather as much data as possible. It's a bit
> vague, I know, so any comments appreciated. That would help me
> un-fuzzy the strangeness :-)
> 
>     Robert> I could go on :(
> 
> Please do ! Then I would just have to implement the tests instead
> of stressing myself about what *else* could go wrong :-)

Well, consider error conditions - see the cherokee web server related
bug reports for instance - where a partially conformant web server can
interact very badly with bzr.

The basic crux of the issue is wide variety of implementations out
there.

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060927/2b0c7439/attachment.pgp 


More information about the bazaar mailing list