Descriptionrelation-ids lists only complete relations
Fixes a problem where the relation-ids hook command, as supported by `HookContext.get_relations`, would return relation ids for relations not fully constructed, that is missing a `UnitRelationState`. Also fixed corresponding test setups, to ensure that these states are in ZK, so as to correspond to what ZK looks like in an actual scenario. Also renamed `Invoker.get_relation_hook_context` to `Invoker.get_cached_relation_hook_context` and changed clients to not yield on it, since it's not actually returning a Deferred. In practice, this seemed to change the behavior such that it went from occasionally failing for a test stack using memcached to *always* failing, before the fix to `get_relations`, at which point it now has succeeded every time.
The stack test I used for verifying this works in practice:
juju deploy --num-units=2 mediawiki
juju deploy mysql
juju deploy memcached
juju add-relation mediawiki:db mysql:db
juju add-relation memcached mediawiki
juju expose mediawiki
jitsu watch --failfast \
mysql --state=started -r "mediawiki:db mysql:db" --setting=database \
memcached --state=started -r "mediawiki memcached" --setting=host \
mediawiki --num-units=2 --state=started --open-port=80
https://code.launchpad.net/~jimbaker/juju/relation-hook-cache-race/+merge/130720
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 8
Patch Set 2 : relation-ids lists only complete relations #
MessagesTotal messages: 4
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||