<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Aug 26, 2014 at 8:06 AM, William Reade <span dir="ltr"><<a href="mailto:william.reade@canonical.com" target="_blank">william.reade@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 class="">On Fri, Aug 22, 2014 at 1:10 PM, Andrew Wilkins<br>
<<a href="mailto:andrew.wilkins@canonical.com">andrew.wilkins@canonical.com</a>> wrote:<br>
> On Fri, Aug 22, 2014 at 11:57 AM, John Meinel <<a href="mailto:john@arbash-meinel.com">john@arbash-meinel.com</a>><br>
> wrote:<br>
</div><div class="">>> I think the problem is that to trigger a restart, the worker itself (in<br>
>> this case APIServer) should be raising the error, which isn't really<br>
>> accessible in the context of the API call. (you want the API call to return<br>
>> successfully, an 'error' in this context is handed to the user, not up the<br>
>> Worker stack.) And the state/apiserver/client.Client object just has a<br>
>> direct reference to State, it doesn't have a reference to<br>
>> state/apiserver.Server to be able to trigger that sort of error in the<br>
>> apiserver.Server.tomb object.<br>
<br>
</div>Yes, the Server needs to finish with an error that communicates the<br>
need to restart upwards.<br>
<br>
In general a facade has references to a number of things, originally<br>
provided by the Server, that it needs to do its job; this STM like<br>
just another dependency like State, Authorizer, etc.<br>
<div class=""><br>
> Is there something wrong with giving Client a reference to the tomb? It<br>
> needs *something*, so I don't see why not that, which would be the least<br>
> amount of work.<br>
<br>
</div>Well, the tomb is kinda private. Least work in the *short* term,<br>
maybe, but... no. ;p<br></blockquote><div><br></div><div>It doesn't have to be the tomb itself; it can be an interface which is implemented by a type wrapping a tomb. My point was that it seems unnecessary to add channels and signalling when we already have that with Runner+Tomb.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
At the moment the FacadeFactory type takes a *State, a Resources, and<br>
an Authorizer (plus a string id): it would not be suitable to *just*<br>
add another parameter to that type, 4 is enough, but it would be fine<br>
to add a parameter type and add a Restarter field there.<br>
<div class=""><br>
>> I guess it depends if this is an API we *ever* want to trigger at any<br>
>> other time than just at the beginning. Maybe we want to have the API so you<br>
>> call "rollback" even if it has been running for a while?<br>
<br>
</div>In particular, we want to roll back failed schema upgrades.<br>
<br>
Cheers<br>
<span class="HOEnZb"><font color="#888888">William<br>
</font></span></blockquote></div><br></div></div>