riak_test/tests/cause_bdp.erl
Kelly McLaughlin 0de33c7b66 Resolve issue with verify_busy_dist_port test hanging indefinitely
The verify_busy_dist_port helper function cause_bdp:spam_nodes/1
recently changed to be more aggressive in triggering busy_dist_port
warnings. The function changed to spawn 1 million processes to ensure
the test generated enough activity to trigger the warnings, but that
number of processes exceeds the 256 thousand process limit that is the
Riak default. One consequence of this can be that the rex server
responsible for handling rpc calls can crash. In some cases this leads
to rpc calls by riak_test to shutdown the riak nodes involved in the
test to hang indefinitely. This change reduces the number of processes
spawned to 200 thousand. This should still be enough processes to
trigger the busy_dist_port warnings, but without exceeding the beam
process limit.
2014-05-06 14:40:47 -06:00

32 lines
1.1 KiB
Erlang

%% -------------------------------------------------------------------
%%
%% cause_bdp - helper module used by verify_busy_dist_port
%%
%% Copyright (c) 2012 Basho Technologies, Inc.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing,
%% software distributed under the License is distributed on an
%% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
%% KIND, either express or implied. See the License for the
%% specific language governing permissions and limitations
%% under the License.
%%
%% -------------------------------------------------------------------
-module(cause_bdp).
-compile(export_all).
spam_nodes(TargetNodes) ->
[[spawn(?MODULE, spam, [N]) || _ <- lists:seq(1,1000*200)] || N <- TargetNodes].
spam(Node) ->
timer:sleep(random:uniform(100)),
catch rpc:call(Node, erlang, whereis, [rex]).