diff --git a/eqc/worker_pool_pulse.erl b/eqc/worker_pool_pulse.erl index 95a5cbe62..e67053157 100644 --- a/eqc/worker_pool_pulse.erl +++ b/eqc/worker_pool_pulse.erl @@ -59,7 +59,7 @@ handle_work(Work, _From, State) -> %% @doc Any amount of work should complete through any size pool. prop_any_pool() -> - ?SETUP(fun setup_and_teardown/1, + ?SETUP(fun setup_and_teardown/0, ?FORALL({Seed, ExtraWork, WorkList}, {pulse:seed(), frequency([{10,true},{1,false}]), diff --git a/src/riak_core_worker_pool.erl b/src/riak_core_worker_pool.erl index addbfff2b..543a03c39 100644 --- a/src/riak_core_worker_pool.erl +++ b/src/riak_core_worker_pool.erl @@ -179,8 +179,14 @@ handle_event(worker_start, StateName, #state{pool=Pool, queue=Q, monitors=Monito {next_state, queueing, State#state{queue=Rem, monitors=NewMonitors}} end; {empty, _} -> - %% StateName might be either 'ready' or 'shutdown' - {next_state, StateName, State} + {next_state, + %% If we are in state queueing with nothing in the queue, + %% move to the ready state so that the next incoming job + %% checks out the new worker from poolboy. + if StateName==queueing -> ready; + true -> StateName + end, + State} end; handle_event(_Event, StateName, State) -> {next_state, StateName, State}.