riak-python-client http timeout?

Michael Johnson mj at mediatemple.net
Wed Jan 2 15:36:29 EST 2013

I am trying to figure out how to set the timeout for riak-python-client for
http connections.  I'm not great with python, but from that I can tell,
it's not possible with the current incarnation of riak-python-client.  It
seems to be defaulting to 60 seconds, but I would like to set that far
lower so that if I have one server out of 5 that is behaving badly, the
client would fail quickly and reconnect to a server that is functioning.

As it stands, this works wonderfully if a server is completely down, but if
it is simply very slow to respond (mimic by using iptables to drop packets)
the connection will not fail for 60 seconds.

It appears some plumbing has been put into place to support passing such
options via the parameter 'transport_options'.  However, this doesn't work
and looking into the code, the data passed in appears to be ignored for
both the http transport and the protocol buffers transport.

Here is the code I've tried that does not work:

client = riak.RiakClient(
  host = '',
  port = 8091,
  prefix = 'riak',
  transport_options = { 'timeout' : 1 }

While the timeout does not have any effect, everything else behaves as
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20130102/6062bcc8/attachment.html>

More information about the riak-users mailing list