Forum: CFEngine Help
Subject: Re: managing cf-execd children
Author: sauer
Link to topic: https://cfengine.com/forum/read.php?3,22992,22999#msg-22999

neilhwatson Wrote:
-------------------------------------------------------
> Aren't these in place already?
> http://cfengine.com/manuals/cf3-reference.html#max_005fchildren-in-agent
> http://cfengine.com/manuals/cf3-reference.html#expireafter-in-agent
> http://cfengine.com/manuals/cf3-reference.html#When-and-where-are-promises-made_003f
> 
> Expireafter can go into the agent control just as
> max_children can.

I do use expireafter (quite a bit, actually), and because it doesn't work if 
there's a database contention issue which screws up the locking.  As a response 
to that, I have a processes promise which looks at the cf-agent processes 
currently running, killing any that have been running too long - or killing all 
cf-agents if there are more than a given threshold active.  It works.

Controls in the agent, however, do not do anything to address my most recent 
issue where cf-promises went berzerk doing the pre-run syntax check.  The agent 
code was never executed because it was waiting forever for the cf-promises to 
return.  I had several thousand machines with tens or hundreds of cf-promises 
instances running on each - and associated cf-agent processes waiting for 
cf-promises to return.  It was a pain to clean up (and to explain). :)  On a 
related note, I'm still trying to reproduce the exact cause of the behavior (in 
3.0.5; it didn't happen in 3.1.5).

In any event, the cf-runagent command has a maxchildren, and cf-agent has  
controls over the children it spawns.  I'm honestly surprised that cf-execd 
lacks it, so I was kinda hoping it existed and was just not documented where 
I'd expect it. :)


I somewhat like Ben's suggestion as a temporary workaround.  I could do 
something like
echo "kill -9 $$" | at now + 15
and then start cf-agent in the shell script.  But I think this is something 
cf-execd should ultimately control internally, as I hate adding yet another 
piece to my cfengine puzzle.

_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to