thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Craig <ben.cr...@gmail.com>
Subject Re: Dealing with out of sequence responses
Date Fri, 30 Oct 2015 02:24:49 GMT
Hi Tyler,
The current code in mainline Thrift does not support that use case.
Basically, if a call times out, then you need to throw away the client
object and reconnect.  In addition, most clients do not allow
multi-threaded access, so you can't interleave a call to ping and add.

With that being said, the wire protocol does support the use case, there
just isn't any code to support it.  Discarding outdated responses is
reasonable, but you would need to make that happen by either modifying
Thrift yourself, or hand crafting the client code to do so.

On Thu, Oct 29, 2015 at 7:06 PM, Tyler Treat <ttreat31@gmail.com> wrote:

> Hi,
>
> I'm curious about Thrift's design around out of sequence responses.
> Consider the sequence of events in this contrived example:
>
> Client calls ping()
> Server receives ping() and sleeps a few seconds
> Client ping() times out
> Client calls add()
> Server finishes sleeping and responds to ping()
> Client gets out of sequence response error (received ping() response when
> expecting add() response)
>
> It seems like what Thrift should do is drop responses with previous
> sequence ids? I.e. if ping() sequence id is 1 and it times out and I call
> add() which expects sequence id 2, I should drop the response with id 1.
>
> Am I thinking about this correctly?
>
> Thanks,
> Tyler
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message