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

Issue 12852044: worker/deployer: add flag to control syslog fwd (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 8 months ago by axw
Modified:
10 years, 8 months ago
Reviewers:
mp+180280, axw1, fwereade
Visibility:
Public.

Description

worker/deployer: add flag to control syslog fwd - Add flag to NewSimpleContext to enable syslog forwarding - Add util function in api/agent, HasJobs(*Entity, params.MachineJob) - Update jujud to make use of these https://code.launchpad.net/~axwalk/juju-core/lp1211147-deployer-check-isstateserver/+merge/180280 (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 (+125 lines, -53 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujud/agent.go View 1 chunk +5 lines, -4 lines 1 comment Download
M cmd/jujud/deploy_test.go View 2 chunks +3 lines, -2 lines 0 comments Download
M cmd/jujud/machine.go View 1 chunk +1 line, -1 line 1 comment Download
M cmd/jujud/machine_test.go View 1 chunk +22 lines, -1 line 0 comments Download
A state/api/agent/utils.go View 1 chunk +18 lines, -0 lines 1 comment Download
M worker/deployer/deployer_test.go View 4 chunks +4 lines, -4 lines 0 comments Download
M worker/deployer/export_test.go View 2 chunks +2 lines, -1 line 0 comments Download
M worker/deployer/simple.go View 4 chunks +35 lines, -26 lines 1 comment Download
M worker/deployer/simple_test.go View 7 chunks +33 lines, -14 lines 0 comments Download

Messages

Total messages: 4
axw
Please take a look.
10 years, 8 months ago (2013-08-15 04:07:08 UTC) #1
fwereade
I'm not sure how unit logs on state servers will get to all-machines.log with this ...
10 years, 8 months ago (2013-08-15 10:04:15 UTC) #2
axw1
On 2013/08/15 10:04:15, fwereade wrote: > I'm not sure how unit logs on state servers ...
10 years, 8 months ago (2013-08-16 02:50:12 UTC) #3
axw1
10 years, 8 months ago (2013-08-19 02:48:47 UTC) #4
On 2013/08/16 02:50:12, axw1 wrote:
> On 2013/08/15 10:04:15, fwereade wrote:
> > I'm not sure how unit logs on state servers will get to all-machines.log
with
> > this change. Not saying they won't, but a comment explaining how would be
> > helpful. A few more thoughts follow:
> 
> They don't, actually. In my haste to fix the original bug, I missed them
> altogether. Thanks for picking that up. I'll look into fixing that and then
> request another review.
> 
> > https://codereview.appspot.com/12852044/diff/1/cmd/jujud/agent.go
> > File cmd/jujud/agent.go (right):
> > 
> > https://codereview.appspot.com/12852044/diff/1/cmd/jujud/agent.go#newcode241
> > cmd/jujud/agent.go:241: forwardSyslog := !apiagent.HasJob(machine,
> > params.JobManageState)
> > It feels like it would be better to calculate this outside this method -- ie
> not
> > to add agent-specific code inside deployer (which is otherwise just using
the
> > deployer api) -- and just pass straight through to newDeployContext.
> 
> Done.
> 
> > https://codereview.appspot.com/12852044/diff/1/cmd/jujud/machine.go
> > File cmd/jujud/machine.go (left):
> > 
> >
https://codereview.appspot.com/12852044/diff/1/cmd/jujud/machine.go#oldcode174
> > cmd/jujud/machine.go:174: case params.JobHostUnits:
> > I can see that it's a little awkward to do the HasJob thing here, but I
still
> > think it's better (because this method is all about agent-level stuff, and
> it's
> > nice not to have to spread that concern down into newDeployer).
> > 
> > https://codereview.appspot.com/12852044/diff/1/state/api/agent/utils.go
> > File state/api/agent/utils.go (right):
> > 
> >
>
https://codereview.appspot.com/12852044/diff/1/state/api/agent/utils.go#newco...
> > state/api/agent/utils.go:11: func HasJob(e *Entity, job params.MachineJob)
> bool
> > {
> > Might this look better as a method on Entity? YMMV.
> 
> I am slightly torn. Originally I was going to make it a method, but my
rationale
> for not doing so was:
>   - The function doesn't need access to anything internal to the Entity
struct,
> and
>   - Entity is pretty minimal, and I didn't want set a precedent for bloating,
> just for a utility method.
> 
> If you have a strong preference for making it a method, please let me know.
> 
> > https://codereview.appspot.com/12852044/diff/1/worker/deployer/simple.go
> > File worker/deployer/simple.go (right):
> > 
> >
>
https://codereview.appspot.com/12852044/diff/1/worker/deployer/simple.go#newc...
> > worker/deployer/simple.go:195: if ctx.forwardSyslog {
> > Hmmmmmmmm. In the context of machines possibly changing jobs in future, it
> might
> > be better to do the removal based only on existence -- we *might* be running
a
> > non-forwarding deployer that had in the distant past installed a unit that
> does
> > forward.
> > 
> > It's a bit speculative, but if there's no obvious reason not to do this I
> think
> > I'd prefer it.
> 
> Good point. I suspect I'll need to change this all a bit anyway, so that a
file
> is always written out, but the contents differ depending on whether or not
it's
> a state machine. If it remains the same, I'll work something out.

I'm abandoning this, as I've found a vastly simpler fix to the problem. The
original config should have worked, it seems there's either a bug or just weird
behaviour in rsyslog.
Sign in to reply to this message.

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