relation-get - missing_unit behavior
Stuart Bishop
stuart.bishop at canonical.com
Mon Jun 24 08:50:35 UTC 2013
On Sat, Jun 22, 2013 at 12:48 PM, Mark Shuttleworth <mark at ubuntu.com> wrote:
> On 06/21/2013 10:26 PM, Gustavo Niemeyer wrote:
>> Fetching relation data for non-existing units does sound pathological
>> and twisted. It means that the charm is basically implying it knows
>> how the context it's being deployed under looks like, including remote
>> units it can talk to.
>
> The rationale is to have charms which are useful in many places. A charm
> which makes assumptions about what's around it is by definition only
> useful when those assumptions are true. So, it would be worth taking the
> time to make it useful with, or without, the relations that may or may
> not show up.
In this case the charm does know what the context its being deployed
under looks like, and the charm isn't making an assumption. It knows
the unit will join the relation eventually (unless it gets removed
before it has a chance to) because of the existing peer relationship.
In this particular case, Juju could know it too. But even if this was
not the case, who would know better than the charm what the context
it's being deployed under looks like? Juju certainly doesn't know the
big picture; it might know what was and what is, but it can't know
what will be, nor understand the why. In my case, the why was I hadn't
thought out a better design ;-)
I do think it is an edge case. I don't know if gaining consistency
here is worth making bugs harder to find when bogus values are passed
to relation-get.
--
Stuart Bishop <stuart.bishop at canonical.com>
More information about the Juju
mailing list