I think your right. I was actually experimenting with this earlier today and saw just the behaviour you described (single thread blocking, queuing, timeouts, etc). -- Jeremy
On Wed, Dec 21, 2011 at 2:07 PM, Ciprian Dorin Craciun < ciprian.crac...@gmail.com> wrote: > On Wed, Dec 21, 2011 at 21:04, Ciprian Dorin Craciun > <ciprian.crac...@gmail.com> wrote: > > On Thu, Dec 15, 2011 at 17:42, Jeremy Raymond <jeraym...@gmail.com> > wrote: > >> Hello, > >> > >> Are calls to the client riakc_pb_socket server blocking if I'm reusing > the > >> same Pid across multiple threads? The pb_socket server will only > process one > >> request at a time? > >> > >> -- > >> Jeremy > > > (The pevious email was "truncated"... :) ) > > Disclaimer: I've only roughly used the `riak_erlang_client` library, > so take my opinion with a grain of "doubt". > > From what I've seen by quickly looking into the Erlang code, it seems > that: > * one request will block the client process (as it uses normal > `gen_server:call` function); > * but two requests from different processes don't "block" the > `riakc_pb_socket` process, as > * internally there is a queue of pending requests, handled in FIFO way; > * but if a lot of requests queue there and stay more than the > timeout option for `gen_server:call` I think they are still going to > be serviced way after you've received a timeout error in your code; > (this has to be investigated); > > My solution is to create a pool of `riakc_pb_socket` and > round-robin through them. > > Hope this helps a bit, > Ciprian. >
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com