Skip to content

Commit

Permalink
Fix broken last commit: start riak_core_node_watcher later in supervi…
Browse files Browse the repository at this point in the history
…sor start sequence
  • Loading branch information
slfritchie committed Oct 16, 2013
1 parent 65ee0a4 commit 4560248
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/riak_core_ring_events_sup.erl
Expand Up @@ -25,7 +25,7 @@
-behaviour(supervisor).

%% API
-export([start_link/0]).
-export([start_link/0, start_late_worker/0]).

%% Supervisor callbacks
-export([init/1]).
Expand All @@ -41,15 +41,20 @@
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).

late_worker_childspec() ->
?CHILD(riak_core_node_watcher, worker).

start_late_worker() ->
supervisor:start_child(?MODULE, late_worker_childspec()).

%% ===================================================================
%% Supervisor callbacks
%% ===================================================================

init([]) ->
Children = lists:flatten(
[
?CHILD(riak_core_ring_events, worker),
?CHILD(riak_core_node_watcher, worker)
?CHILD(riak_core_ring_events, worker)
]),

{ok, {{one_for_all, 9999, 10}, Children}}.
2 changes: 2 additions & 0 deletions src/riak_core_vnode_manager.erl
Expand Up @@ -206,6 +206,8 @@ get_all_vnodes(Mod) ->

%% @private
init(_State) ->
{ok, _Pid} = riak_core_ring_events_sup:start_late_worker(),
error_logger:warning_msg("YO started late worker ~p\n", [_Pid]),
{ok, Ring, CHBin} = riak_core_ring_manager:get_raw_ring_chashbin(),
Mods = [Mod || {_, Mod} <- riak_core:vnode_modules()],
State = #state{forwarding=dict:new(), handoff=dict:new(),
Expand Down

0 comments on commit 4560248

Please sign in to comment.