Skip to content

Commit

Permalink
Since this FSM has no timeout and the remote index FSM has no timeout
Browse files Browse the repository at this point in the history
by default, we can get stuck with both FSMs partially completed and
holding on to a lot of memory.

This fix adds a timeout to the remote FSM so it should terminate in a
timely fashion, but adds a timeout to the connection request, just in
case the other end stops talking to us for some reason.
  • Loading branch information
evanmcc committed Feb 11, 2014
1 parent 75d030a commit 6e7027e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/riak_cs_list_objects_fsm_v2.erl
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,9 @@ make_2i_request(RiakcPid, State=#state{req=?LOREQ{name=BucketName},
os:timestamp()),
Opts = [{max_results, BatchSize},
{start_key, StartKey},
{end_key, EndKey}],
{end_key, EndKey},
{timeout, timer:minutes(1)},
{call_timeout, timer:minutes(1) + timer:seconds(10)}],
FoldResult = riakc_pb_socket:cs_bucket_fold(RiakcPid,
ManifestBucket,
Opts),
Expand Down

0 comments on commit 6e7027e

Please sign in to comment.