In https://github.com/apache/couchdb/blob/master/src/rexi/src/rexi_sup.erl#L23 
noticed it's one_for_one strategy, so if any of the top level children dies and 
restarts (like say rexi_sup did in the log), when rexi_sup respawns, nothing 
will restart all the rexi servers.

`rexi_server_mon` only checks if it needs to restart servers on cluster 
membership changes and on startup: 
https://github.com/apache/couchdb/blob/master/src/rexi/src/rexi_server_mon.erl#L56-L63

So maybe we'd want a `rest_for_one` strategy in rexi_sup (in addition to 
increasing the intensity check timeout in rexi_server_sup?).


```
init([]) ->
    {ok, {{rest_for_one, 3, 10}, [
        {
            rexi_server,
            {rexi_server, start_link, [rexi_server]},
            permanent,
            100,
            worker,
            [rexi_server]
        },
        {
            rexi_server_sup,
            {rexi_server_sup, start_link, [rexi_server_sup]},
            permanent,
            100,
            supervisor,
            [rexi_server_sup]
        },
        {
            rexi_server_mon,
            {rexi_server_mon, start_link, [rexi_server]},
            permanent,
            100,
            worker,
            [rexi_server_mon]
        },
        {
            rexi_buffer_sup,
            {rexi_server_sup, start_link, [rexi_buffer_sup]},
            permanent,
            100,
            supervisor,
            [rexi_server_sup]
        },
        {
            rexi_buffer_mon,
            {rexi_server_mon, start_link, [rexi_buffer]},
            permanent,
            100,
            worker,
            [rexi_server_mon]
        }
    ]}}.

```

In this case if rexi_server_sup dies, it will down rexi_server_mon (well and 
unfortunately the buffers), but then on restart it will bring back 
rexi_server_mon and it should repopulate the servers in rexi_server_sup.




[ Full content available at: https://github.com/apache/couchdb/issues/1571 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to