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

Issue 6482053: IT LIVES (er, the Uniter, that is)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 7 months ago by fwereade
Modified:
12 years, 7 months ago
Reviewers:
mp+121021
Visibility:
Public.

Description

IT LIVES (er, the Uniter, that is) Featuring: * installation (not really resumable, except by luck) * install, start, config-changed hooks * error resolution of same, and resuming in the right place * response to further service config changes when in ModeStarted * slightly too many testing types, that will be used imminently for followup branches, and which I am therefore reluctant to delete now Not Featuring: * upgrades/conflict resolution * relations * anything to do with lifecycles https://code.launchpad.net/~fwereade/juju-core/it-lives/+merge/121021 Requires: https://code.launchpad.net/~fwereade/juju-core/dumb-charm-manager/+merge/121007 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 20

Patch Set 2 : IT LIVES (er, the Uniter, that is) #

Patch Set 3 : IT LIVES (er, the Uniter, that is) #

Total comments: 14

Patch Set 4 : IT LIVES (er, the Uniter, that is) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1120 lines, -56 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M juju/testing/conn.go View 2 chunks +32 lines, -18 lines 0 comments Download
M trivial/trivial.go View 1 1 chunk +10 lines, -5 lines 0 comments Download
M worker/uniter/charm/charm.go View 1 2 3 5 chunks +11 lines, -6 lines 0 comments Download
M worker/uniter/hook/hook.go View 1 2 3 1 chunk +19 lines, -16 lines 0 comments Download
M worker/uniter/hook/hook_test.go View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
A worker/uniter/modes.go View 1 2 3 1 chunk +217 lines, -0 lines 0 comments Download
M worker/uniter/relationer_test.go View 2 chunks +6 lines, -8 lines 0 comments Download
A worker/uniter/uniter.go View 1 2 3 1 chunk +215 lines, -0 lines 0 comments Download
A worker/uniter/uniter_test.go View 1 2 3 1 chunk +605 lines, -0 lines 0 comments Download

Messages

Total messages: 6
fwereade
Please take a look.
12 years, 7 months ago (2012-08-23 15:22:44 UTC) #1
niemeyer
This is superb. Thanks a lot for the hard work, certainly paid off. Some very ...
12 years, 7 months ago (2012-08-23 22:27:37 UTC) #2
fwereade
Please take a look. https://codereview.appspot.com/6482053/diff/1/worker/uniter/modes.go File worker/uniter/modes.go (right): https://codereview.appspot.com/6482053/diff/1/worker/uniter/modes.go#newcode18 worker/uniter/modes.go:18: // ModeInit determines the Mode ...
12 years, 7 months ago (2012-08-24 13:14:14 UTC) #3
fwereade
Please take a look.
12 years, 7 months ago (2012-08-24 13:52:44 UTC) #4
niemeyer
This is looking great, thank you. LGTM with just a few trivials: https://codereview.appspot.com/6482053/diff/1/worker/uniter/uniter.go File worker/uniter/uniter.go ...
12 years, 7 months ago (2012-08-27 17:24:26 UTC) #5
fwereade
12 years, 7 months ago (2012-08-28 09:23:41 UTC) #6
*** Submitted:

IT LIVES (er, the Uniter, that is)

Featuring:

  * installation (not really resumable, except by luck)
  * install, start, config-changed hooks
  * error resolution of same, and resuming in the right place
  * response to further service config changes when in ModeStarted
  * slightly too many testing types, that will be used imminently for
    followup branches, and which I am therefore reluctant to delete now

Not Featuring:

  * upgrades/conflict resolution
  * relations
  * anything to do with lifecycles

R=niemeyer
CC=
https://codereview.appspot.com/6482053

https://codereview.appspot.com/6482053/diff/1/worker/uniter/uniter.go
File worker/uniter/uniter.go (right):

https://codereview.appspot.com/6482053/diff/1/worker/uniter/uniter.go#newcode87
worker/uniter/uniter.go:87: u.tomb.Kill(u.pinger.Stop())
On 2012/08/27 17:24:26, niemeyer wrote:
> On 2012/08/24 13:14:14, fwereade wrote:
> > On 2012/08/23 22:27:38, niemeyer wrote:
> > > The logic above is a bit suspect. If it's not dying, kill? Why is it
> ignoring
> > > the error if it is dying?
> > > 
> > > How about:
> > > 
> > > u.tomb.Kill(err)
> > > u.tomb.Kill(u.pinger.Stop())
> > > 
> > > ?
> > 
> > Ha, yes; and I should return nil instead of ErrDying in the modes, which
> > actually seems sensible -- Dying is in this instance not an error at all.
> Done.
> 
> Not as a coincidence, ErrDying should work fine in those cases, and I suggest
> keeping it. Returning a bad mode with err == nil will be surprising. 

As discussed, the issue is the collision between ErrorContextf and ErrDying.

https://codereview.appspot.com/6482053/diff/7001/juju/testing/conn.go
File juju/testing/conn.go (right):

https://codereview.appspot.com/6482053/diff/7001/juju/testing/conn.go#newcode33
juju/testing/conn.go:33: // Reset returns environment state to that which
existed at the start of
On 2012/08/27 17:24:26, niemeyer wrote:
> This feels pretty suspect. A bit premature to say that as I haven't seen
actual
> use cases thus far in the review, but it feels like a huge hint that a test
> could actually be split in two.

As discussed, this is to let me write the uniter tests as tables but start each
one with a fresh environment.

https://codereview.appspot.com/6482053/diff/7001/worker/uniter/charm/charm.go
File worker/uniter/charm/charm.go (right):

https://codereview.appspot.com/6482053/diff/7001/worker/uniter/charm/charm.go...
worker/uniter/charm/charm.go:97: var surl *string
On 2012/08/27 17:24:26, niemeyer wrote:
> s/*//
Huh, what was I thinking :/. Done.

https://codereview.appspot.com/6482053/diff/7001/worker/uniter/charm/charm.go...
worker/uniter/charm/charm.go:104: return charm.ParseURL(*surl)
On 2012/08/27 17:24:26, niemeyer wrote:
> s/*//

Done.

https://codereview.appspot.com/6482053/diff/7001/worker/uniter/hook/hook.go
File worker/uniter/hook/hook.go (right):

https://codereview.appspot.com/6482053/diff/7001/worker/uniter/hook/hook.go#n...
worker/uniter/hook/hook.go:95: // Pending indicates that execution of the hook
has started. A hook
On 2012/08/27 17:24:26, niemeyer wrote:
> s/has started/is pending/ :-)

Done.

https://codereview.appspot.com/6482053/diff/7001/worker/uniter/modes.go
File worker/uniter/modes.go (right):

https://codereview.appspot.com/6482053/diff/7001/worker/uniter/modes.go#newco...
worker/uniter/modes.go:125: return nil, nil
On 2012/08/27 17:24:26, niemeyer wrote:
> ErrDying was more sensible here. Having wrong result data with err == nil is
> error prone.

Done.

https://codereview.appspot.com/6482053/diff/7001/worker/uniter/modes.go#newco...
worker/uniter/modes.go:167: return nil, nil
On 2012/08/27 17:24:26, niemeyer wrote:
> Ditto.

Done.
Sign in to reply to this message.

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