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

Issue 63710044: uniter: fix intermittent failure

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 2 months ago by fwereade
Modified:
10 years, 2 months ago
Reviewers:
mp+206353, william.reade, jameinel, rog
Visibility:
Public.

Description

uniter: fix intermittent failure I couldn't repro it here, but was consistently seeing failures on the bot in which the verifyFile target had empty content, which seemed to imply a race between reading and writing it once it was determined to exist. If that's the problem, this should fix it. https://code.launchpad.net/~fwereade/juju-core/intermittent-juju-run-failure/+merge/206353 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -16 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M state/apiserver/uniter/uniter.go View 2 chunks +11 lines, -10 lines 2 comments Download
M state/apiserver/uniter/uniter_test.go View 3 chunks +18 lines, -4 lines 0 comments Download
M worker/uniter/context_test.go View 1 chunk +1 line, -1 line 0 comments Download
M worker/uniter/uniter_test.go View 1 chunk +2 lines, -1 line 2 comments Download

Messages

Total messages: 5
fwereade
Please take a look.
10 years, 2 months ago (2014-02-14 08:41:14 UTC) #1
rog
LGTM although really I question why asyncRunCommands is asynchronous at all. https://codereview.appspot.com/63710044/diff/1/worker/uniter/uniter_test.go File worker/uniter/uniter_test.go (right): ...
10 years, 2 months ago (2014-02-14 11:29:44 UTC) #2
fwereade
https://codereview.appspot.com/63710044/diff/1/worker/uniter/uniter_test.go File worker/uniter/uniter_test.go (right): https://codereview.appspot.com/63710044/diff/1/worker/uniter/uniter_test.go#newcode852 worker/uniter/uniter_test.go:852: return fmt.Sprintf("echo juju run ${JUJU_UNIT_NAME} > %s.tmp; mv %s.tmp ...
10 years, 2 months ago (2014-02-14 12:21:17 UTC) #3
jameinel
some questions about rationale, but just discussion points. https://codereview.appspot.com/63710044/diff/1/state/apiserver/uniter/uniter.go File state/apiserver/uniter/uniter.go (right): https://codereview.appspot.com/63710044/diff/1/state/apiserver/uniter/uniter.go#newcode75 state/apiserver/uniter/uniter.go:75: _, ...
10 years, 2 months ago (2014-02-17 07:05:08 UTC) #4
william.reade
10 years, 2 months ago (2014-02-17 09:03:42 UTC) #5
https://codereview.appspot.com/63710044/diff/1/state/apiserver/uniter/uniter.go
File state/apiserver/uniter/uniter.go (right):

https://codereview.appspot.com/63710044/diff/1/state/apiserver/uniter/uniter....
state/apiserver/uniter/uniter.go:75: _, name, err := names.ParseTag(tag,
names.UnitTagKind)
On 2014/02/17 07:05:09, jameinel wrote:
> This seems like you could end up missing NotFound errors that you might want
to
> get. Is that a safe change?
> 
> I guess you could assume units won't be calling this without knowing what it
is,
> and maybe we've already validated it elsewhere?

We'll still get NotFounds from the code below; the point of this change is that
if we haven't validated the tags properly (which we generally haven't) we'll get
nice wrong-entity-type errors instead of panicking the API server.
Sign in to reply to this message.

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