Closed ycliuhw closed 6 years ago
The -broken
hook handling with RelationBase
-based interface layers is known to be pretty broken, and is a little non-obvious how to work around (you can't use -broken
, obviously, and -departed
is called for every departing unit). This is part of why the alternative Endpoint
was created. TBH, it would be easier to convert to that than to try to fix the RelationBase
implementation. Let me take a look at it.
understood. Thanks for responding for this, @johnsca . I will take a look Endpoint
as well.
@ycliuhw Please see the referenced PR for the conversion to Endpoints
, if you haven't already.
@johnsca thank you very much for the PR which is looking great. Just one minor docstring thing.
hi @johnsca I found an error raised from
uniter hook runner
when I ranjuju remove-relation
.The root cause is
self.conversation
is not accessible for eventserver-relation-broken
because inRelationBase.conversation
method, the scope var will beNone
when the relation class scope set tonon GLOBAL
-JUJU_REMOTE_UNIT=""
in this case.the logs as below ->
I am thinking there are two ways to solve this:
to set to the scope to
GLOBAL
inprovides.py
but i am not sure if it will broadcast to all relations that mysql has;def departed
handler only listensserver-relation-departed
event but notserver-relation-broken
(I saw there are some cleanup did in non reactive charm https://api.jujucharms.com/charmstore/v5/mysql-58/archive/hooks/db-relation-broken, wondering how to achieve this in reactive charm here)would you mind to give some advise?
Thank you very much. Kelvin