API change: relation-broken hook context
gustavo.niemeyer at canonical.com
Fri Dec 9 15:31:13 UTC 2011
> It has become apparent that RelationHookContext is somewhat broken in
> the context of relation-broken: that is to say that commands like
> get-members are not guaranteed to work correctly, because state they
> depend upon may already have been deleted (by, say, the client
> requesting service destruction).
> I propose that relation-broken should execute in a plain old HookContext
> (just like install/start/etc, but with JUJU_RELATION_NAME -- which is
> useful -- set in the environment).
That sounds fine in principle. I actually believe we should obsolete
relation-broken (in a compatible way, not removing it now), and make
more clear the guarantees we offer for relation-departed. If we
guarantee that relation-departed is necessarily run for any unit that
has ever seen a relation-join, the use of relation-broken is quite
uninteresting. relation-broken == relation-departed with
len(get-members) == 0.
-- I'm not absolutely sure of anything.
More information about the Juju