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

Issue 6856122: state: MachineUnitsWatcher unwatches correct units

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 5 months ago by fwereade
Modified:
11 years, 5 months ago
Reviewers:
Visibility:
Public.

Description

state: MachineUnitsWatcher unwatches correct units This means that stopped MUWs no longer end up blocking the watcher. To help detect problems like this more easily in future, the watcher package now panics when unwatching an unknown key. And I fixed RelationScopeWatcher, which was using the old'n'busted double- loop style, and replaced "changeChan"s with "out"s for those watchers that I expect to continue to exist (ie not MachinePrincipalUnitsWatcher). Sorry, I couldn't resist. https://code.launchpad.net/~fwereade/juju-core/state-muw-unwatch-fix/+merge/137133 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1

Patch Set 2 : state: MachineUnitsWatcher unwatches correct units #

Total comments: 5

Patch Set 3 : state: MachineUnitsWatcher unwatches correct units #

Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -32 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M state/watcher.go View 1 9 chunks +20 lines, -31 lines 0 comments Download
M state/watcher/watcher.go View 1 3 chunks +14 lines, -1 line 0 comments Download

Messages

Total messages: 8
fwereade
Please take a look.
11 years, 5 months ago (2012-11-30 09:38:27 UTC) #1
rog
On 2012/11/30 09:38:27, fwereade wrote: > Please take a look. LGTM is it possible to ...
11 years, 5 months ago (2012-11-30 09:47:17 UTC) #2
TheMue
LGTM
11 years, 5 months ago (2012-11-30 09:47:58 UTC) #3
fwereade
Please take a look.
11 years, 5 months ago (2012-11-30 11:15:42 UTC) #4
rog
LGTM nice to see something that would have made the tests fail. https://codereview.appspot.com/6856122/diff/4001/state/watcher/watcher.go File state/watcher/watcher.go ...
11 years, 5 months ago (2012-11-30 11:21:47 UTC) #5
TheMue
LGTM, and supporting Rogers comments. https://codereview.appspot.com/6856122/diff/4001/state/watcher/watcher.go File state/watcher/watcher.go (right): https://codereview.appspot.com/6856122/diff/4001/state/watcher/watcher.go#newcode67 state/watcher/watcher.go:67: func (k watchKey) String() ...
11 years, 5 months ago (2012-11-30 11:30:50 UTC) #6
ricky.kernberger
https://codereview.appspot.com/6856122/diff/1/state/watcher.go File state/watcher.go (left): https://codereview.appspot.com/6856122/diff/1/state/watcher.go#oldcode1311 state/watcher.go:1311: for _, unit := range w.known { murks
11 years, 5 months ago (2012-11-30 11:34:11 UTC) #7
fwereade
11 years, 5 months ago (2012-11-30 11:40:42 UTC) #8
*** Submitted:

state: MachineUnitsWatcher unwatches correct units

This means that stopped MUWs no longer end up blocking the watcher. To help
detect problems like this more easily in future, the watcher package now
panics when unwatching an unknown key.

And I fixed RelationScopeWatcher, which was using the old'n'busted double-
loop style, and replaced "changeChan"s with "out"s for those watchers that
I expect to continue to exist (ie not MachinePrincipalUnitsWatcher). Sorry,
I couldn't resist.

R=ricky.kernberger
CC=
https://codereview.appspot.com/6856122
Sign in to reply to this message.

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