Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

rework coverage fsm timeouts. #302

Merged
merged 2 commits into from

3 participants

@evanmcc

Current coverage fsm timeouts arent' consistent with the way other timeouts in riak work. This change makes it so they're bounded by the total time given by the init functions, rather than applying their timeout to their waiting phases, which could be unbounded if there are multiple calls to waiting_results.

@evanmcc evanmcc Current coverage fsm timeouts arent' consistent with the way other
timeouts in riak work.  This change makes it so they're bounded
by the total time given by the init functions, rather than applying
their timeout to their waiting phases, which could be unbounded
if there are multiple calls to waiting_results.
1fe4059
@evanmcc evanmcc referenced this pull request in basho/riak_test
Merged

test for bucket and key listing timeouts #263

@evanmcc evanmcc was assigned
@seancribbs
Owner

I'm generally :+1: but there should be a review from another person, e.g. @jtuple @jrwest @engelsanchez @rzezeski

@kellymclaughlin
Collaborator

+1 to merge

@evanmcc evanmcc was assigned
@evanmcc evanmcc merged commit 8a754d4 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 18, 2013
  1. @evanmcc

    Current coverage fsm timeouts arent' consistent with the way other

    evanmcc authored
    timeouts in riak work.  This change makes it so they're bounded
    by the total time given by the init functions, rather than applying
    their timeout to their waiting phases, which could be unbounded
    if there are multiple calls to waiting_results.
Commits on May 24, 2013
  1. @evanmcc

    Merge branch 'master' into pevm-coverage-timeout-refactor

    evanmcc authored
    Conflicts:
    	src/riak_core_coverage_fsm.erl
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/riak_core_coverage_fsm.erl
View
5 src/riak_core_coverage_fsm.erl
@@ -159,6 +159,7 @@ init([Mod,
{Request, VNodeSelector, NVal, PrimaryVNodeCoverage,
NodeCheckService, VNodeMaster, Timeout, ModState} =
Mod:init(From, RequestArgs),
+ gen_fsm:start_timer(Timeout, {timer_expired, Timeout}),
PlanFun = plan_callback(Mod, Exports),
ProcessFun = process_results_callback(Mod, Exports),
StateData = #state{mod=Mod,
@@ -169,7 +170,7 @@ init([Mod,
pvc = PrimaryVNodeCoverage,
request=Request,
req_id=ReqId,
- timeout=Timeout,
+ timeout=infinity,
vnode_master=VNodeMaster,
plan_fun = PlanFun,
process_fun = ProcessFun},
@@ -250,6 +251,8 @@ waiting_results({{ReqId, VNode}, Results},
Mod:finish(Error, ModState),
{stop, Error, StateData}
end;
+waiting_results({timeout, _, _}, #state{mod=Mod, mod_state=ModState}) ->
+ Mod:finish({error, timeout}, ModState);
waiting_results(timeout, #state{mod=Mod, mod_state=ModState}) ->
Mod:finish({error, timeout}, ModState).
Something went wrong with that request. Please try again.