basho/riak-erlang-client — pull request #156 by reiddraper (2014-02-18 22:02:38+00:00)
Title: Unify timeouts

There are three different types of timeouts used. They are not consistently named. The three timeouts are:

1. `gen_server:call/3`. This is sometimes called the `call_timeout`, and if not provided, defaults to 60 seconds. I think it should always be infinity.
1. Request timeout. This timeout is most often the last parameter to a given exported function. Sometimes it's also specified as the 'timeout' value in an options proplist. When requests are queued up (see #155), the timer is started. If the timer goes off before the response has been read from the socket, the caller received an `{error, timeout`} response. I think this value should always be an integer (ie. never infinity).
1. Remote timeout. This is a value that is encoded in the protocol buffers _request_, and is used on the _Riak_ side as a timeout. Some functions (inconsistently) also call this value the 'Timeout' (last parameter), and hardcode the 'Request timeout' to infinity. I think this value should never be specified instead of the 'Request timeout' in the function parameters, but be called `remote_timeout` in an options property. This value can be an integer or infinity. Some examples of functions that hardcode infinity Request timeouts and instead take in the server timeout are [`cs_bucket_fold`](https://github.com/basho/riak-erlang-client/blob/1.4.2/src/riakc_pb_socket.erl#L912), [`stream_list_buckets`](https://github.com/basho/riak-erlang-client/blob/1.4.2/src/riakc_pb_socket.erl#L402-L404) and [`stream_list_keys`](https://github.com/basho/riak-erlang-client/blob/1.4.2/src/riakc_pb_socket.erl#L469).

Because of this confusion, some tests have been removed because they were failing (and could be fixed easily). ie. 82e7964dd58401ad3d7eecb3a55e3bd62b54747d.

Mentioning folks who've touched this code recently: @evanmcc, @russelldb.

See also #155.