[rabbitmq-discuss] Issue with delayed restart of children in supervisor2

Ilya Staheev istaheev at gmail.com
Mon Nov 26 12:03:57 GMT 2012


Hi,

supervisor2 treats start of a child after the delay as a restart of the 
child which might lead to weird behavior in some cases. Imagine the 
situation when a bunch of children are restarted simultaneously for some 
reason so that maximum restart frequency has been reached. If all children 
have {permanent | transient | intrinsic, Delay} in their child 
specifications then supervisor2 delays restart of them for Delay seconds. 
After the delay all the children are restarted simultaneously and 
supervisor2 applies same rules for checking maximal restart frequency 
again. If amount of children is greater than MaxR then first MaxR children 
are started normally, without any delays between each other, but then 
supervisor2 begins to think that maximum restart frequency is reached again 
and introduce a delay before it begins to start the rest of the children. 

1. N children fail simultaneously (N > MaxR).
2. supervisor2 waits for Delay second.
3. supervisor2 begins to restart failed children.
4. First MaxR children have been restarted.
5. supervisor2 reaches maximum restart frequency.
6. supervisor2 waits for Delay seconds.   <-- bad
7. The (MaxR+1)'th child is started.
8. After the next MaxR children the same effect with delay appears.
...

It is not good behaviour from my point of view, start of a child after the 
delay should not be treated as restart with restarts counting and I would 
like to fix it. Patch is attached. Thank you in advance.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121126/27026892/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: supervisor2.diff
Type: text/x-diff
Size: 2638 bytes
Desc: not available
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121126/27026892/attachment.diff>


More information about the rabbitmq-discuss mailing list