HomePhorge

(#3581) Stop forking around: Add fork helper method
1b810b1b8a5dUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#3581) Stop forking around: Add fork helper method

Without this patch we are forking all over the place. All this forking
around is problematic when it comes to things like ActiveRecord and
database connections. It turns out that forking has a nasty side effect
of aggressively closing database connections and spewing errors all over
the place.

This patch introduces a new Puppet::Util#safe_posix_fork method that
does forking the right way (closing file descriptors, and resetting
stdin, stdout, and stderr). Tagmail, Puppet kick, and
Puppet::Util#execute_posix have been updated to make use of this new
functionality.

In the future, Puppet::Util#safe_posix_fork should be used in-place of
direct calls to Kernel#fork.

This patch includes related spec tests.

Details

Provenance
Kelsey Hightower <kelsey@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUd88f3e7c387e: Merge pull request #613 from puppetlabs/geordi
Branches
Unknown
Tags
Unknown

Event Timeline

Kelsey Hightower <kelsey@puppetlabs.com> committed rPU1b810b1b8a5d: (#3581) Stop forking around: Add fork helper method (authored by Kelsey Hightower <kelsey@puppetlabs.com>).Apr 3 2012, 8:20 PM