FullStatus API when machine or unit is StatusDown
Kapil Thangavelu
kapil.thangavelu at canonical.com
Fri May 23 03:22:59 UTC 2014
On Sun, May 18, 2014 at 9:55 PM, Menno Smits <menno.smits at canonical.com>wrote:
> I'm working on a change to make "juju status" report the remote unit when
> a relation hook fails (https://bugs.launchpad.net/juju-core/+bug/1194481).
>
>
fwiw, i've updated to reflect that the underlying obscurity is much reduced
already via inclusion of relation-name.
> During this work I've noticed that the FullStatus client API does some
> munging of the agent state info string if the agent appears to be dead but
> shouldn't be. It replaces the agent state info string with "(status: status
> info)" (note the parens) and then changes the returned status to
> StatusDown. You've probably noticed juju status strings with parens around
> them before - this is why.
>
>
indeed, i've mostly noticed it because it happens often when it never
should (new units/agents coming up).
> This code is at state/apiserver/client/status.go:540.
>
> This is problematic for two reasons:
>
> 1. the client API code is making formatting decisions that should be
> left up to the client. In the case of the ticket I'm working on, the juju
> status command handler ends up having to detect and unpick the parens in
> status string while generating the status output so that it can correctly
> append the remote unit name. This is easy enough but ugly and feels wrong.
>
> agreed.
>
> 1. because the munging is done within the FullStatus API call, clients
> that are consuming events via a watcher will not see the munged status and
> info. If a client was to use both a watcher and FullStatus, it could see
> different status values for a unit or machine between the two APIs.
>
>
+ ugh
>
>
> What I'd like to do is not have the client API munge the status info
> string and instead use the StatusData map to report the record the original
> status. When a unit or machine status is StatusDown a client can look in
> StatusData for the pre-agent-down status if it wants it.
>
sounds good.
>
> It would also be good to move the "if agent down set the status to
> StatusDown" logic to somewhere deeper so that all clients get a consistent
> view of the status. I can live with it if this isn't feasible however -
> this part isn't necessary to get the ticket done.
>
> I'm concerned that this change may impact the GUI. As far as I can tell
> the GUI doesn't call FullStatus so any changes to that API shouldn't affect
> it (please correct me if I'm wrong). Changing how StatusDown is set however
> will probably impact the GUI.
>
the gui doesn't call fullstatus afaik, but it is not the only api consumer,
gui is primarily on the watch api and then fetching/mutating individual
entities (services, units).
-k
>
> Thoughts?
>
> - Menno
>
>
>
>
>
>
>
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20140522/b7bc7ea6/attachment.html>
More information about the Juju-dev
mailing list