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

Issue 10078043: state: added CleanupWatcher (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by mue
Modified:
10 years, 9 months ago
Reviewers:
dimitern, mp+167748, fwereade
Visibility:
Public.

Description

state: added CleanupWatcher The CleanupWatcher signals the demand for the running of state.Cleanup(). It is the first in a row of CLs to add an according worker. https://code.launchpad.net/~themue/juju-core/024-cleanup-watcher/+merge/167748 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 5

Patch Set 2 : state: added CleanupWatcher #

Total comments: 14

Patch Set 3 : state: added CleanupWatcher #

Total comments: 13

Patch Set 4 : state: added CleanupWatcher #

Unified diffs Side-by-side diffs Delta from patch set Stats (+142 lines, -0 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M state/state_test.go View 1 2 3 1 chunk +90 lines, -0 lines 0 comments Download
M state/watcher.go View 1 2 3 1 chunk +50 lines, -0 lines 0 comments Download

Messages

Total messages: 10
mue
Please take a look.
10 years, 10 months ago (2013-06-06 12:01:24 UTC) #1
fwereade
Sorry, NOT LGTM. This does not do what we agreed (notify on any change to ...
10 years, 10 months ago (2013-06-06 16:26:44 UTC) #2
mue
https://codereview.appspot.com/10078043/diff/1/state/watcher.go File state/watcher.go (right): https://codereview.appspot.com/10078043/diff/1/state/watcher.go#newcode1244 state/watcher.go:1244: // After a unit is found to be Dead, ...
10 years, 10 months ago (2013-06-06 16:54:17 UTC) #3
mue
Please take a look.
10 years, 10 months ago (2013-06-07 08:52:18 UTC) #4
dimitern
A few comments. https://codereview.appspot.com/10078043/diff/6001/state/state.go File state/state.go (right): https://codereview.appspot.com/10078043/diff/6001/state/state.go#newcode1079 state/state.go:1079: TxnRevno int64 `bson:"txn-revno"` You don't need ...
10 years, 10 months ago (2013-06-07 09:15:37 UTC) #5
fwereade
LGTM with dimitern's comments addressed and some better tests for the watcher. Sorry for the ...
10 years, 10 months ago (2013-06-07 09:35:44 UTC) #6
fwereade
just another comment on the tests https://codereview.appspot.com/10078043/diff/6001/state/state_test.go File state/state_test.go (right): https://codereview.appspot.com/10078043/diff/6001/state/state_test.go#newcode1357 state/state_test.go:1357: defer cw.Stop() I ...
10 years, 10 months ago (2013-06-07 09:40:10 UTC) #7
mue
Please take a look. https://codereview.appspot.com/10078043/diff/6001/state/state.go File state/state.go (right): https://codereview.appspot.com/10078043/diff/6001/state/state.go#newcode1079 state/state.go:1079: TxnRevno int64 `bson:"txn-revno"` On 2013/06/07 ...
10 years, 10 months ago (2013-06-07 12:05:01 UTC) #8
dimitern
LGTM with a few comments changed. https://codereview.appspot.com/10078043/diff/14002/state/state_test.go File state/state_test.go (right): https://codereview.appspot.com/10078043/diff/14002/state/state_test.go#newcode1363 state/state_test.go:1363: c.Fatalf("unexpected change: %v", ...
10 years, 10 months ago (2013-06-07 12:24:49 UTC) #9
mue
10 years, 10 months ago (2013-06-07 13:36:56 UTC) #10
*** Submitted:

state: added CleanupWatcher

The CleanupWatcher signals the demand for the running of
state.Cleanup(). It is the first in a row of CLs to add 
an according worker.

R=fwereade, dimitern
CC=
https://codereview.appspot.com/10078043

https://codereview.appspot.com/10078043/diff/14002/state/state_test.go
File state/state_test.go (right):

https://codereview.appspot.com/10078043/diff/14002/state/state_test.go#newcod...
state/state_test.go:1363: c.Fatalf("unexpected change: %v", ok)
On 2013/06/07 12:24:50, dimitern wrote:
> please change this to say "unexpected change; ok: %v"

Done.

https://codereview.appspot.com/10078043/diff/14002/state/state_test.go#newcod...
state/state_test.go:1383: // Add relations doesn't emit events.
On 2013/06/07 12:24:50, dimitern wrote:
> // Adding relations doesn't emit events.

Done.

https://codereview.appspot.com/10078043/diff/14002/state/state_test.go#newcod...
state/state_test.go:1415: // A cleanup without need doesn't emit events.
On 2013/06/07 12:24:50, dimitern wrote:
> // Verify that Cleanup() doesn't emit unnecessary events.

Done.

https://codereview.appspot.com/10078043/diff/14002/state/state_test.go#newcod...
state/state_test.go:1420: // Don't handle each event keeps them in the queue.
Cleanups
On 2013/06/07 12:24:50, dimitern wrote:
> // Not calling Cleanup() queues up the changes, so that
> // multiple changes will be emitted the next time Cleanup()
> // is called. This behavior will change in a follow-up.

That's not correct, the second part is related to the internal behavior of
Cleanup() with individual transactions per deletion. Will separate this better.

https://codereview.appspot.com/10078043/diff/14002/state/watcher.go
File state/watcher.go (right):

https://codereview.appspot.com/10078043/diff/14002/state/watcher.go#newcode1251
state/watcher.go:1251: // CleanupWatcher notifies changes of the cleanup
documents
On 2013/06/07 12:24:50, dimitern wrote:
> // CleanupWatcher notifies of changes in the cleanups collection.
> ?

Done.

https://codereview.appspot.com/10078043/diff/14002/state/watcher.go#newcode1258
state/watcher.go:1258: // WatchCleanups returns a CleanupWatcher that notifies
when documents
On 2013/06/07 12:24:50, dimitern wrote:
> // WatchCleanups starts and returns a CleanupWatcher.

Done.
Sign in to reply to this message.

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