<html><head></head><body bgcolor="#FFFFFF"><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">On 6 Jun 2013, at 20:01, Paul Rubin <<a href="mailto:paul@mongohq.com">paul@mongohq.com</a>> wrote:</span></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>I wonder if what's really going on here is a gap in the available supervision strategies.  I was a bit surprised to learn from the supervisor docs,<br>

<br><div style="margin-left:40px">"To prevent a supervisor from getting into an infinite loop of
      child process terminations and restarts, a <i>maximum restart frequency</i> is defined using two integer values <code>MaxR</code>
      and <code>MaxT</code>. If more than <code>MaxR</code> restarts occur within
      <code>MaxT</code> seconds, the supervisor terminates all child
      processes and then itself."<br></div><br></div><div>I had somehow thought that if MaxR restarts happened in MaxT seconds, the supervisor would just sleep until MaxT seconds had passed, then start retrying again (i.e. limit the frequency rather than the absolute count).  It does seem to me there should be an option for something like that.  </div></div></div></div></div></blockquote><div><br></div><div>Whilst this is orthogonal to the points covered already, it might be worth mentioning that RabbitMQ uses its own copy of supervisor, imaginatively named supervisor2, which offers this feature under the name "delayed restarts". A child restart configured with {Type, Delay} will use Type to handle restarts unless it hits the maximum restart intensity, at which point it will try again after Delay. With Type set to permanent for example, that basically means the supervisor will keep trying to restart forever. We use this in some plugins to provide a reconnect/retry delay option.</div><div><br></div><div>At some point we could submit a patch to OTP, if there's any appetite for incorporating it.</div><div><br></div><div>Cheers,</div><div>Tim</div></body></html>