You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2018/08/22 17:50:00 UTC
[couchdb] branch master updated: Switch rexi_sup restart strategy
to rest_for_one
This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/master by this push:
new 2350cd4 Switch rexi_sup restart strategy to rest_for_one
2350cd4 is described below
commit 2350cd4e0602a3ef4d0fa79096294e558ddaf475
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Tue Aug 21 18:35:28 2018 -0400
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
---
src/rexi/src/rexi_sup.erl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rexi/src/rexi_sup.erl b/src/rexi/src/rexi_sup.erl
index 55c4829..3d9aa2a 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]},