On Fri, Jan 13, 2012 at 11:45, Stefan Schulte
<[email protected]> wrote:
> On Fri, Jan 13, 2012 at 09:46:46AM -0800, Daniel Pittman wrote:
>> G'day.
>>
>> At the moment we have some parts of the Puppet code that have a
>> lurking bug around ActiveRecord: when we fork, if an AR database
>> connection is open, we will break that connection in the parent when
>> the child exits.
>
> Is there a way to identify the database handles? I just found an
> interesting article about the difference of fork and popen and how to
> set the close_on_exec flag:
>
> http://cmdrclueless.com/blog/2009/07/06/activerecord-fork-exec-boom/

The same article I read while I was trying to work out why this happened. :)

> The article just sets the flag for all IO objects. Can we just execute
> the code snippet once or would it be necessary to execute it before
> every fork call?

Technically, only after every file handle was opened, but given that
we can't know every time that happens we are kind of stuck doing it
before every fork.

-- 
Daniel Pittman
⎋ Puppet Labs Developer – http://puppetlabs.com
♲ Made with 100 percent post-consumer electrons

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to