nickva commented on code in PR #5491:
URL: https://github.com/apache/couchdb/pull/5491#discussion_r2178108570


##########
src/couch_stats/src/couch_stats_sup.erl:
##########
@@ -20,15 +20,25 @@
 ]).
 
 -define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
+-define(CSRT_SUP, couch_stats_csrt_sup).
 
 start_link() ->
     supervisor:start_link({local, ?MODULE}, ?MODULE, []).
 
 init([]) ->
+    %% Use a dedicated CSRT supervisor with restart strategy set to transient
+    %% so that if a CSRT failure arrises that triggers the sup rate limiter
+    %% thresholds, that shutdown signal will bubble up here and be ignored,
+    %% as the use of transient specifies that `normal` and `shutdown` signals
+    %% are ignored.
+    %% Switch this to `permanent` once CSRT is out of experimental stage.
+    CSRTSup =
+        {?CSRT_SUP, {?CSRT_SUP, start_link, []}, transient, infinity, 
supervisor, [?CSRT_SUP]},

Review Comment:
   I don't know if transient does what we want here? If a transient child 
crashes it will still restart?
   
   EDIT: Asked Russell in a meeting about this and the idea is that the 
transient supervisor would still crash but once it reaches its max restart 
limit it will shutdown. `shutdown` is a normal stop, so then the transient 
child will stop but not propagate the crash further up.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to