Skip to content

Commit

Permalink
Merge pull request #160 from basho/feature/remove-infinity-timeouts
Browse files Browse the repository at this point in the history
Never use infinity request timeouts
  • Loading branch information
reiddraper committed Feb 19, 2014
2 parents 8d33c02 + 39b8048 commit 786f460
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/riakc_pb_socket.erl
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ stream_list_buckets(Pid, Options) ->
ReqId = mk_reqid(),
gen_server:call(Pid, {req, #rpblistbucketsreq{timeout=ServerTimeout,
stream=true},
infinity, {ReqId, self()}}, infinity).
ServerTimeout, {ReqId, self()}}, infinity).

legacy_list_buckets(Pid, Options) ->
ServerTimeout =
Expand All @@ -410,7 +410,7 @@ legacy_list_buckets(Pid, Options) ->
ST -> ST
end,
gen_server:call(Pid, {req, #rpblistbucketsreq{timeout=ServerTimeout},
infinity}, infinity).
ServerTimeout}, infinity).


%% @doc List all keys in a bucket
Expand Down Expand Up @@ -466,7 +466,7 @@ stream_list_keys(Pid, Bucket, Options) ->
end,
ReqMsg = #rpblistkeysreq{bucket = Bucket, timeout = ServerTimeout},
ReqId = mk_reqid(),
gen_server:call(Pid, {req, ReqMsg, infinity, {ReqId, self()}},
gen_server:call(Pid, {req, ReqMsg, ServerTimeout, {ReqId, self()}},
infinity).

%% @doc Get bucket properties.
Expand Down Expand Up @@ -823,9 +823,9 @@ get_index_eq(Pid, Bucket, Index, Key, Opts) ->
Call = case Stream of
true ->
ReqId = mk_reqid(),
{req, Req, infinity, {ReqId, self()}};
{req, Req, Timeout, {ReqId, self()}};
false ->
{req, Req, infinity}
{req, Req, Timeout}
end,
gen_server:call(Pid, Call, CallTimeout).

Expand Down Expand Up @@ -875,9 +875,9 @@ get_index_range(Pid, Bucket, Index, StartKey, EndKey, Opts) ->
Call = case Stream of
true ->
ReqId = mk_reqid(),
{req, Req, infinity, {ReqId, self()}};
{req, Req, Timeout, {ReqId, self()}};
false ->
{req, Req, infinity}
{req, Req, Timeout}
end,
gen_server:call(Pid, Call, CallTimeout).

Expand Down Expand Up @@ -909,7 +909,7 @@ cs_bucket_fold(Pid, Bucket, Opts) when is_pid(Pid), is_binary(Bucket), is_list(O
continuation=Continuation,
timeout=Timeout},
ReqId = mk_reqid(),
Call = {req, Req, infinity, {ReqId, self()}},
Call = {req, Req, Timeout, {ReqId, self()}},
gen_server:call(Pid, Call, CallTimeout).

%% @doc Return the default timeout for an operation if none is provided.
Expand Down

0 comments on commit 786f460

Please sign in to comment.