Browse files

Let vnode crash on exit signal

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...
1 parent c0b43d3 commit 96a97a67756c2e92796b20bcf8491aad800509ec @rzezeski rzezeski committed Jun 7, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/riak_search_vnode.erl
@@ -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}) ->

0 comments on commit 96a97a6

Please sign in to comment.