Hi Michael, Sorry for the month-late response here.
I spoke with Sean, Evan, and the team a bit about this. There's not a straight-forward way to do this right now with python client. The best approach would probably be something server-side that's interface-specific, but that's not in place yet. I'll dig around tonight to see if there's an open issue for it. Mark On Wed, Jan 2, 2013 at 12:36 PM, Michael Johnson <[email protected]> wrote: > 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 = '127.0.0.1', > port = 8091, > prefix = 'riak', > transport_class=riak.RiakHttpTransport, > transport_options = { 'timeout' : 1 } > ) > client1.get_buckets() > > While the timeout does not have any effect, everything else behaves as > expected. > > > _______________________________________________ > riak-users mailing list > [email protected] > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > _______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
