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

Issue 6489083: combine charm and hook states as uniter state

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

Description

combine charm and hook states as uniter state charm.Manager and hook.StateFile have together been replaced by charm.Deployer and uniter.StateFile. The bits of charm.Manager that were not already subsumed by charm.Deployer moved into uniter.StateFile, as did everything in hook.StateFile; the overriding benefit of doing this is that it allows us to switch atomically from a deploying state into a queued-hook state at the end of Uniter.deploy. The addition of StateFile is technically independent, but I feel it's useful to see the change as a *move* of the local-state-saving code; apart from those additions/deletions, the primary feature is a rewritten Uniter.deploy; the state-reading changes in modes.go are largely mechanical, apart from the move of a chunk of ModeInit into ModeContinue (because we can now determine everything about what mode we should be in purely from the state file, there is no longer any reason to split it across two modes; and ModeInit can keep doing things that really are about initialization). In short: don't fear the diff :). https://code.launchpad.net/~fwereade/juju-core/uniter-use-deployer/+merge/122838 Requires: https://code.launchpad.net/~fwereade/juju-core/uniter-charm-deployer/+merge/122807 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : combine charm and hook states as uniter state #

Patch Set 3 : combine charm and hook states as uniter state #

Total comments: 21

Patch Set 4 : combine charm and hook states as uniter state #

Patch Set 5 : combine charm and hook states as uniter state #

Unified diffs Side-by-side diffs Delta from patch set Stats (+568 lines, -539 lines) Patch
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujud/unit_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M worker/uniter/charm/charm.go View 2 chunks +0 lines, -137 lines 0 comments Download
M worker/uniter/charm/charm_test.go View 1 2 3 4 2 chunks +8 lines, -87 lines 0 comments Download
M worker/uniter/charm/git.go View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M worker/uniter/hook/hook.go View 1 2 4 chunks +17 lines, -127 lines 0 comments Download
M worker/uniter/hook/hook_test.go View 1 2 2 chunks +41 lines, -44 lines 0 comments Download
M worker/uniter/modes.go View 1 2 3 7 chunks +72 lines, -71 lines 0 comments Download
A worker/uniter/state.go View 1 2 3 1 chunk +148 lines, -0 lines 0 comments Download
A worker/uniter/state_test.go View 1 2 3 1 chunk +171 lines, -0 lines 0 comments Download
M worker/uniter/uniter.go View 1 2 3 4 8 chunks +60 lines, -50 lines 0 comments Download
M worker/uniter/uniter_test.go View 1 2 3 4 13 chunks +45 lines, -22 lines 0 comments Download

Messages

Total messages: 6
fwereade
Please take a look.
11 years, 7 months ago (2012-09-05 11:04:27 UTC) #1
fwereade
Please take a look.
11 years, 7 months ago (2012-09-06 21:41:46 UTC) #2
niemeyer
Really appreciate the direction this is going. Have a few mostly boring comments, and one ...
11 years, 7 months ago (2012-09-11 14:52:04 UTC) #3
fwereade
Please take a look. https://codereview.appspot.com/6489083/diff/3001/worker/uniter/modes.go File worker/uniter/modes.go (right): https://codereview.appspot.com/6489083/diff/3001/worker/uniter/modes.go#newcode52 worker/uniter/modes.go:52: log.Printf("examining persistent state...") On 2012/09/11 ...
11 years, 7 months ago (2012-09-12 15:16:40 UTC) #4
niemeyer
LGTM, thanks! https://codereview.appspot.com/6489083/diff/3001/worker/uniter/uniter.go File worker/uniter/uniter.go (right): https://codereview.appspot.com/6489083/diff/3001/worker/uniter/uniter.go#newcode205 worker/uniter/uniter.go:205: if err := u.op.Write(Abide, Pending, &hi, nil); ...
11 years, 7 months ago (2012-09-12 20:58:17 UTC) #5
fwereade
11 years, 7 months ago (2012-09-13 08:29:48 UTC) #6
*** Submitted:

combine charm and hook states as uniter state

charm.Manager and hook.StateFile have together been replaced by charm.Deployer
and uniter.StateFile.

The bits of charm.Manager that were not already subsumed by charm.Deployer
moved into uniter.StateFile, as did everything in hook.StateFile; the
overriding benefit of doing this is that it allows us to switch atomically
from a deploying state into a queued-hook state at the end of Uniter.deploy.

The addition of StateFile is technically independent, but I feel it's useful
to see the change as a *move* of the local-state-saving code; apart from those
additions/deletions, the primary feature is a rewritten Uniter.deploy; the
state-reading changes in modes.go are largely mechanical, apart from the move
of a chunk of ModeInit into ModeContinue (because we can now determine
everything about what mode we should be in purely from the state file, there
is no longer any reason to split it across two modes; and ModeInit can keep
doing things that really are about initialization).

In short: don't fear the diff :).

R=niemeyer
CC=
https://codereview.appspot.com/6489083
Sign in to reply to this message.

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