<div dir="ltr">Hi Bogdan<div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 26, 2015 at 1:29 PM, Bogdan Teleaga <span dir="ltr"><<a href="mailto:bteleaga@cloudbasesolutions.com" target="_blank">bteleaga@cloudbasesolutions.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">This has been a WIP for a while now so maybe some of you have heard<br>
about it.<br>
<br>
It all started out with us needing to have hook retried after a random<br>
reboot and it evolved into retrying hooks upon any kind of failure.<br>
<br>
So as of now failing hooks will be retried automatically after a<br>
certain time. The minimum wait time will be 20 seconds, while the<br>
maximum will be 20 minutes and it's going to increase with a factor of<br>
2 for every failure. Also a small jitter is introduced for a bit of<br>
randomness. Using juju resolved will overwrite this timer and cause it<br>
to restart at the beginning.<br>
<br>
I've tested it for a while and it has proven to be relatively robust<br>
in my tests. Probably having a CI test soonish would be recommended.<br>
<br>
The waiting amount has been chosen relatively arbitratily so if anyone<br>
has comments or ideas for that, I'm open to suggestions. The<br>
discussion for that should go<br>
here(<a href="https://github.com/juju/juju/pull/3835" rel="noreferrer" target="_blank">https://github.com/juju/juju/pull/3835</a>), since apparently I<br>
merged the branch with some values I used in testing and did not<br>
change them back to the intended ones.<br></blockquote><div><br></div><div>In the daily deluge of email I managed to miss your post to list, and stumbled upon this feature whilst exercising 1.26 alpha3 with some development work this week and assumed it was a bug:</div><div><br></div><div>  <a href="https://bugs.launchpad.net/juju-core/+bug/1535711">https://bugs.launchpad.net/juju-core/+bug/1535711</a><br></div><div><br></div><div>I think this is a dangerous behaviour to introduce to Juju; a hook error should be a signal to an end user that something really bad happened, and that they need to dig in further (preferably with points from status messages); if the function that a hook is performing is re-tryable, that needs to be handled in charm and not by Juju IMHO.</div><div><br></div><div>Specifically I was testing some changes to the odl-controller charm; this feature covered up a race in the charm hook code accessing the API of ODL, which I failed to notice the first few times I deployed (not paying attention due to multi-tasking), and then had me scratching my head as to what was going on when I started to notice the hook failure.</div><div><br></div><div>Cheers</div><div><br></div><div>James</div></div></div></div>