Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (43 sloc) 1.75 KB
%% -------------------------------------------------------------------
%% riak_vnode_sup: supervise riak_vnode processes
%% Copyright (c) 2007-2010 Basho Technologies, Inc. All Rights Reserved.
%% 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
%% Unless required by applicable law or agreed to in writing,
%% software distributed under the License is distributed on an
%% KIND, either express or implied. See the License for the
%% specific language governing permissions and limitations
%% under the License.
%% -------------------------------------------------------------------
%% @doc supervise riak_vnode processes
-export([start_link/0, init/1]).
start_vnode(Mod, Index, ForwardTo) when is_integer(Index) ->
supervisor_pre_r14b04:start_child(?MODULE, [Mod, Index, ForwardTo]).
start_link() ->
%% We use a custom copy of the supervisor module that is expected to be
%% part of R14B04 or R15. This includes the patch that allows
%% simple_one_for_one supervisors to do a controlled shutdown.
%% This is needed because we need to make sure vnode shutdown triggers
%% async worker pool shutdown AND blocks waiting for the worker pool to
%% terminate.
supervisor_pre_r14b04:start_link({local, ?MODULE}, ?MODULE, []).
%% @private
init([]) ->
{{simple_one_for_one, 10, 10},
{riak_core_vnode, start_link, []},
temporary, 300000, worker, dynamic}]}}.
Something went wrong with that request. Please try again.