summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Vatamaniuc <vatamane@apache.org>2018-08-21 18:35:28 -0400
committerNick Vatamaniuc <nickva@users.noreply.github.com>2018-08-22 13:49:57 -0400
commit2350cd4e0602a3ef4d0fa79096294e558ddaf475 (patch)
tree07693f5d02f3ef5caab387c3afbb05b838046c30
parentf82b156e20ec5fd82be191dbf6044fca0b5f0386 (diff)
downloadcouchdb-2350cd4e0602a3ef4d0fa79096294e558ddaf475.tar.gz
Switch rexi_sup restart strategy to rest_for_one
Previously, as described in issue #1571, `rexi_server_sup` supervisor could die and restart. After it restarts `rexi_server_mon` would not respan rexi servers as it wouldn't notice `rexi_server_sup` went away and come back. That would leave the cluster in a disabled state. To fix the issue, switch restart strategy to `rest_for_one`. In this case, if a child at the top dies it will restart all the children below it in the list. For example, if `rexi_server` dies, it will restart all the children. If `rexi_server_sup` dies, it will restart `rexi_server_mon`. And then on restart `rexi_server_mon` will properly spawn all the rexi servers. Same for the buffers, if `rexi_buffer_sup` dies, it will restart `rexi_buffer_mon` and on restart it will spawn buffers as expected. Fixes: #1571
-rw-r--r--src/rexi/src/rexi_sup.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rexi/src/rexi_sup.erl b/src/rexi/src/rexi_sup.erl
index 55c482998..3d9aa2a16 100644
--- a/src/rexi/src/rexi_sup.erl
+++ b/src/rexi/src/rexi_sup.erl
@@ -20,7 +20,7 @@ start_link(Args) ->
supervisor:start_link({local,?MODULE}, ?MODULE, Args).
init([]) ->
- {ok, {{one_for_one, 3, 10}, [
+ {ok, {{rest_for_one, 3, 10}, [
{
rexi_server,
{rexi_server, start_link, [rexi_server]},