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

Issue 91350044: Take hook exec lock in container host init

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

Description

Take hook exec lock in container host init When initialising the host for a container type, we will install packages (lxc, kvm, etc.); this can conflict with hook execution. This CL modifies the container initialisation code to acquire the hook execution lock when initialisting the host to avoid the conflict. Fixes lp:1317197 https://code.launchpad.net/~axwalk/juju-core/lp1317197-containerinit-hooklock/+merge/219157 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4

Patch Set 2 : Take hook exec lock in container host init #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -20 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujud/agent.go View 1 3 chunks +10 lines, -0 lines 0 comments Download
M cmd/jujud/machine.go View 1 2 chunks +5 lines, -0 lines 2 comments Download
M cmd/jujud/unit.go View 1 2 chunks +6 lines, -2 lines 0 comments Download
M worker/provisioner/container_initialisation.go View 5 chunks +15 lines, -3 lines 0 comments Download
M worker/provisioner/container_initialisation_test.go View 7 chunks +34 lines, -6 lines 0 comments Download
M worker/uniter/uniter.go View 1 2 chunks +4 lines, -8 lines 0 comments Download
M worker/uniter/uniter_test.go View 1 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 5
axw
Please take a look.
9 years, 11 months ago (2014-05-12 09:26:38 UTC) #1
fwereade
This'd be fine if it used the same lock as the uniter does. I'd be ...
9 years, 11 months ago (2014-05-12 13:59:28 UTC) #2
axw
Please take a look. https://codereview.appspot.com/91350044/diff/1/cmd/jujud/machine.go File cmd/jujud/machine.go (right): https://codereview.appspot.com/91350044/diff/1/cmd/jujud/machine.go#newcode387 cmd/jujud/machine.go:387: lockDir := filepath.Join(agentConfig.DataDir(), "locks") On ...
9 years, 11 months ago (2014-05-13 02:21:29 UTC) #3
wallyworld
LGTM https://codereview.appspot.com/91350044/diff/20001/cmd/jujud/machine.go File cmd/jujud/machine.go (right): https://codereview.appspot.com/91350044/diff/20001/cmd/jujud/machine.go#newcode385 cmd/jujud/machine.go:385: initLock, err := hookExecutionLock(agentConfig.DataDir()) minor nitpick, the code ...
9 years, 11 months ago (2014-05-13 03:02:45 UTC) #4
axw
9 years, 11 months ago (2014-05-13 03:06:06 UTC) #5
https://codereview.appspot.com/91350044/diff/20001/cmd/jujud/machine.go
File cmd/jujud/machine.go (right):

https://codereview.appspot.com/91350044/diff/20001/cmd/jujud/machine.go#newco...
cmd/jujud/machine.go:385: initLock, err :=
hookExecutionLock(agentConfig.DataDir())
On 2014/05/13 03:02:45, wallyworld wrote:
> minor nitpick, the code in unit.go uses a var:
> dataDir := agentConfig.DataDir()
> 
> Would be great to be consistent

Only because dataDir is used by something else in the uniter code; it's not
here. I'd prefer not to introduce an identifier unless it's actually necessary.
Sign in to reply to this message.

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