Skip to content

Commit

Permalink
Let vnode crash on exit signal
Browse files Browse the repository at this point in the history
If a linked process, such as the merge index process or worker pool,
crashes then restart the vnode since it's pid values will be obsolete.
  • Loading branch information
rzezeski committed Jun 11, 2012
1 parent c0b43d3 commit 96a97a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/riak_search_vnode.erl
Expand Up @@ -203,8 +203,10 @@ delete(VState=#vstate{bmod=BMod, bstate=BState}) ->
ok = BMod:drop(BState),
{ok, VState}.

handle_exit(_Pid, normal, _State) ->
{noreply, _State}.
handle_exit(_Pid, Reason, State) ->
%% A linked process has crashed potentially causing pid values,
%% such as merge index or worker pool, to become obsolete.
{stop, Reason, State}.

terminate(_Reason, #vstate{bmod=BMod, bstate=BState}) ->
BMod:stop(BState),
Expand Down

0 comments on commit 96a97a6

Please sign in to comment.