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

Issue 12254043: worker: Deployer/MinUnitsWorker use StringsWorker (Closed)

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

Description

worker: Deployer/MinUnitsWorker use StringsWorker Both MinUnitsWorker and Deployer now use the new StringsWorker. Code refactored and simplified, no other changes. Live tested on EC2. https://code.launchpad.net/~dimitern/juju-core/085-use-stringsworker/+merge/178073 Requires: https://code.launchpad.net/~dimitern/juju-core/084-stringsworker/+merge/178032 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4

Patch Set 2 : worker: Deployer/MinUnitsWorker use StringsWorker #

Unified diffs Side-by-side diffs Delta from patch set Stats (+136 lines, -194 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujud/agent.go View 1 chunk +1 line, -1 line 0 comments Download
M worker/deployer/deployer.go View 5 chunks +41 lines, -66 lines 0 comments Download
M worker/deployer/deployer_test.go View 7 chunks +70 lines, -74 lines 0 comments Download
M worker/minunitsworker/minunitsworker.go View 2 chunks +20 lines, -50 lines 0 comments Download
M worker/minunitsworker/minunitsworker_test.go View 2 chunks +2 lines, -3 lines 0 comments Download

Messages

Total messages: 5
dimitern
Please take a look.
10 years, 9 months ago (2013-08-01 14:05:27 UTC) #1
mue
LGTM, looks cleaner now. New approach is really good.
10 years, 9 months ago (2013-08-01 14:10:19 UTC) #2
rog
LGTM, although still unconvinced that the line count reduction is worth the less obvious control ...
10 years, 9 months ago (2013-08-01 14:49:26 UTC) #3
gz
LGTM https://codereview.appspot.com/12254043/diff/1/worker/deployer/deployer.go File worker/deployer/deployer.go (right): https://codereview.appspot.com/12254043/diff/1/worker/deployer/deployer.go#newcode66 worker/deployer/deployer.go:66: func (d *Deployer) SetUp() (api.StringsWatcher, error) { The ...
10 years, 9 months ago (2013-08-01 15:00:32 UTC) #4
dimitern
10 years, 9 months ago (2013-08-01 15:42:21 UTC) #5
Please take a look.

https://codereview.appspot.com/12254043/diff/1/worker/deployer/deployer.go
File worker/deployer/deployer.go (right):

https://codereview.appspot.com/12254043/diff/1/worker/deployer/deployer.go#ne...
worker/deployer/deployer.go:66: func (d *Deployer) SetUp() (api.StringsWatcher,
error) {
On 2013/08/01 15:00:33, gz wrote:
> The logic in here is a little non-obvious to me, but it's just the same as the
> lead section of the old loop function, so fair enough.

Yeah, exactly - what used to be done before the main loop in loop() is done here
now. Take a look at stringsworker.go - the loop().

https://codereview.appspot.com/12254043/diff/1/worker/minunitsworker/minunits...
File worker/minunitsworker/minunitsworker_test.go (right):

https://codereview.appspot.com/12254043/diff/1/worker/minunitsworker/minunits...
worker/minunitsworker/minunitsworker_test.go:35: defer func() {
c.Assert(worker.Stop(mu), gc.IsNil) }()
On 2013/08/01 15:00:33, gz wrote:
> Seems like the old spelling would have kept working anyway, as it just takes a
> Stopper interface?

Not really, because now the worker.Worker is used, and it doesn't have a Stop()
method, instead worker.Stop(w) is used, which internally calls w.Kill and
w.Wait.
Sign in to reply to this message.

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