bzr.dev <-> bzr.dev network api break
Andrew Bennetts
andrew at canonical.com
Mon Jan 21 21:31:14 GMT 2008
Robert Collins wrote:
>
> On Mon, 2008-01-21 at 20:47 +1100, Andrew Bennetts wrote:
> >
> > So, I think we should:
> >
> > * create a protocol version 3 that can cope with this situation
> > safely, and
> > * teach the client to fallback to methods that don't require sending
> > request
> > bodies if the protocol version < 3.
>
> I think that the second point is a bit bogus; the client should try its
> best method, with the best protocol version it knows.
>
> It will get one of:
> protocol unknown
> method unknown
>
> If it gets protocol unknown, it has to:
> - drop the session
> - start a new session with a lower protocol version
>
> If it gets method unknown, it has to:
> - if the method was sending a body:
> - check if the protocol handles that cleanly:
> - if not drop the session
> - retry with an older method
Well, dropping the connection is an option too, as I think I said in the
original mail. The bit you quoted was just what I thought we should do: given
that we know that no non-VFS methods take request bodies in the current
protocol, if we do a protocol bump at the same time as we introduce a method
that does accept a request body, then we can use "if protocol < 2" as a shortcut
to deciding if we should even try it in the first place. And this would avoid
dropping a connection, which would be nice.
Also, if protocol version 3 can safely handle unknown methods, even if they have
request bodies, then with my approach we don't need any "drop the session" logic
at all, except in the initial "protocol unknown" situation.
-Andrew.
More information about the bazaar
mailing list