Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6)

Issue 6749057: relation-ids lists only complete relations

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 4 months ago by jimbaker
Modified:
13 years, 3 months ago
Reviewers:
jameinel, mp+130720
Visibility:
Public.

Description

relation-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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+138 lines, -48 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M juju/hooks/invoker.py View 1 chunk +2 lines, -2 lines 0 comments Download
M juju/hooks/protocol.py View 4 chunks +5 lines, -5 lines 0 comments Download
M juju/hooks/tests/test_invoker.py View 6 chunks +16 lines, -15 lines 0 comments Download
M juju/state/hook.py View 1 3 chunks +18 lines, -7 lines 0 comments Download
M juju/state/tests/test_hook.py View 1 5 chunks +80 lines, -15 lines 0 comments Download
M juju/unit/tests/test_lifecycle.py View 2 chunks +15 lines, -4 lines 0 comments Download

Messages

Total messages: 4
jimbaker
Please take a look.
13 years, 4 months ago (2012-10-22 03:01:19 UTC) #1
jameinel
Martin worked with me to review this code. Overall the code changes look good, just ...
13 years, 3 months ago (2012-10-29 15:00:53 UTC) #2
jimbaker
Please look again, I made the suggested fixes. https://codereview.appspot.com/6749057/diff/1/juju/state/hook.py File juju/state/hook.py (right): https://codereview.appspot.com/6749057/diff/1/juju/state/hook.py#newcode118 juju/state/hook.py:118: yield ...
13 years, 3 months ago (2012-10-29 20:54:44 UTC) #3
jimbaker
13 years, 3 months ago (2012-10-29 20:55:40 UTC) #4
Please take a look.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b