<div dir="ltr">^^ s/immutability/idempotency</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 5, 2017 at 12:39 PM, Casey Marshall <span dir="ltr"><<a href="mailto:casey.marshall@canonical.com" target="_blank">casey.marshall@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Thu, Jan 5, 2017 at 3:33 AM, Adam Collard <span dir="ltr"><<a href="mailto:adam.collard@canonical.com" target="_blank">adam.collard@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<br><br>The automatic hook retries[0] that landed as part of 2.0 (are documented as) run indefinitely[1] - this causes problems as an API user:<br><br>Imagine you are driving Juju using the API, and when you perform an operation (e.g. set the configuration of a service, or reboot the unit, or add a relation..) - you want to show the status of that operation.<br><br>Prior to the automatic retries, you simply perform your operation, and watch the delta streams for the corresponding change to the unit - the success or otherwise of the operation is reflected in the unit agent-status/workload-status pair.<br><br>Now, with retries, if you see a unit in the error state, you can't accurately reflect the status of the operation, since the unit will undoubtedly retry the hook again. Maybe it succeeds, maybe it fails again. How can one say after receiving the first delta of a unit error if the operation succeeded or failed?<br><br>With no visibility up front on the retry strategy that Juju will perform (e.g. something representing the exponential backoff and a fixed number of retries before Juju admits defeat) it is impossible to say at any point in the delta stream what the result of a failed-at-least-once operation is.<br></div></blockquote><div><br></div></span><div>I think the retry strategy is great -- it leverages the immutability we expect hooks to provide, to deliver a robust result over unreliable substrates -- and all substrates are unreliable where there's internetworking involved!</div><div><br></div><div>However I see your point about the retry strategy muddling status. I've noticed this sometimes when watching openstack or k8s bundles "shake out" the errors as they come up. I don't think this is always a charm quality issue, it's maybe because we're trying to show two different things with status?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"></blockquote><div>What if Juju made a clearer distinction between result-state ("what I'm doing most recently or last attempted to do") vs. goal-state ("what I'm trying to get done") in the status? Would that help?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class=""><div dir="ltr"><br>Can retries be limited to a small number, with a backoff algorithm explicitly documented and stuck to by Juju, with the retry attempt number included in the delta stream?<br><br>Thanks,<br><br>Adam<br><br>[0] <a href="https://jujucharms.com/docs/2.0/reference-release-notes" target="_blank">https://jujucharms.com/docs/2.<wbr>0/reference-release-notes</a><br>[1] <a href="https://jujucharms.com/docs/2.0/models-config#retrying-failed-hooks" target="_blank">https://jujucharms.com/docs/2.<wbr>0/models-config#retrying-faile<wbr>d-hooks</a></div>
<br></span><span class="HOEnZb"><font color="#888888">--<br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com" target="_blank">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailm<wbr>an/listinfo/juju-dev</a><br>
<br></font></span></blockquote></div><br></div></div>
</blockquote></div><br></div>