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

Issue 52470044: juju run should always use hook execution lock

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 3 months ago by thumper
Modified:
10 years, 3 months ago
Reviewers:
mp+201702, wallyworld
Visibility:
Public.

Description

juju run should always use hook execution lock When juju run executes remotely, for services and units it was grabbing the file system lock for the hook execution to make sure things are serialized appropriately. This branch makes sure that the machine executions also use the file system lock to make sure the commands are serialized. https://code.launchpad.net/~thumper/juju-core/juju-run-just-lock/+merge/201702 Requires: https://code.launchpad.net/~thumper/juju-core/run-cmd-refactor/+merge/201680 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+183 lines, -66 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujud/run.go View 5 chunks +63 lines, -21 lines 3 comments Download
M cmd/jujud/run_test.go View 5 chunks +78 lines, -9 lines 4 comments Download
M state/apiserver/client/run.go View 2 chunks +5 lines, -2 lines 0 comments Download
M state/apiserver/client/run_test.go View 3 chunks +3 lines, -3 lines 0 comments Download
D utils/fslock/export_test.go View 1 chunk +0 lines, -15 lines 0 comments Download
M utils/fslock/fslock.go View 2 chunks +7 lines, -5 lines 0 comments Download
M utils/fslock/fslock_test.go View 3 chunks +1 line, -11 lines 0 comments Download
A utils/fslock/package_test.go View 1 chunk +24 lines, -0 lines 0 comments Download

Messages

Total messages: 3
thumper
Please take a look.
10 years, 3 months ago (2014-01-15 01:06:48 UTC) #1
wallyworld
LGTM with some consideration to my questions https://codereview.appspot.com/52470044/diff/1/cmd/jujud/run.go File cmd/jujud/run.go (right): https://codereview.appspot.com/52470044/diff/1/cmd/jujud/run.go#newcode42 cmd/jujud/run.go:42: If --no-context ...
10 years, 3 months ago (2014-01-15 02:03:17 UTC) #2
thumper
10 years, 3 months ago (2014-01-15 03:09:12 UTC) #3
https://codereview.appspot.com/52470044/diff/1/cmd/jujud/run.go
File cmd/jujud/run.go (right):

https://codereview.appspot.com/52470044/diff/1/cmd/jujud/run.go#newcode42
cmd/jujud/run.go:42: If --no-context is specified, the <unit-name> positional
On 2014/01/15 02:03:18, wallyworld wrote:
> Not sure if --no-unit would be better here from a user perspective?

Users don't see this.  This is only really used by the juju run apiserver
component.

https://codereview.appspot.com/52470044/diff/1/cmd/jujud/run_test.go
File cmd/jujud/run_test.go (right):

https://codereview.appspot.com/52470044/diff/1/cmd/jujud/run_test.go#newcode138
cmd/jujud/run_test.go:138: s.PatchValue(&fslock.LockWaitDelay,
10*time.Millisecond)
On 2014/01/15 02:03:18, wallyworld wrote:
> should this be ShortWait?

No, I wanted to make sure that it checked faster than short wait, otherwise
there was the potential that after unlocking, it didn't have enough time to
execute fully.

https://codereview.appspot.com/52470044/diff/1/cmd/jujud/run_test.go#newcode146
cmd/jujud/run_test.go:146: c.Assert(err, gc.ErrorMatches, "timeout")
On 2014/01/15 02:03:18, wallyworld wrote:
> What happens if this assert fails? The lock will still be held. Will that
> adversely affect other tests? I think we should either add cleanup or change
the
> Assert to Check

No, the lock is in the LockDir, which is mocked out above in a temporary test
directory.
Sign in to reply to this message.

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