Hook -relation-broken is broken with charms.reactive

Cory Johns cory.johns at canonical.com
Fri Dec 18 21:49:21 UTC 2015


I recently stumbled across https://bugs.launchpad.net/juju-core/+bug/1098442
by way of realizing that the @hook('{relation_name}-relation-broken')
handlers in my interface layer were not doing anything.  At all.

It turns out that without knowing for what remote unit the -relation-broken
hook is running, charms.reactive cannot get, set, or remove any states for
any conversations in which that unit had participated.  This renders the
-relation-broken hook completely unusable in reactive charms.

However, the -relation-departed hook works perfectly fine.

I think I have a way that I could reconstruct the appropriate remote unit
name in charms.reactive to make the -relation-broken hook work as expected,
but given the fact that -relation-departed works just as well, I'm not sure
if there is enough of a use-case for the -broken hook to warrant it.

So I wanted to put it to the community.  Is there something that
-relation-broken would let you do that -relation-departed could not
accomplish just as easily?  Is there any reason to try to make it work, or
should we just deprecate -relation-broken for reactive charms, possibly
even making it an error to try to react to it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20151218/1f14ca3c/attachment.html>


More information about the Juju mailing list