summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan McLellan <btm@opscode.com>2012-02-09 08:22:02 -0800
committerBryan McLellan <btm@opscode.com>2012-02-09 08:28:09 -0800
commit64f5dd096d6df9a6425f758326c4aae952551c2d (patch)
tree6d94d5369f201185430ea1e8cbe8e2d4f3425c9c
parente7360a2eb0e050bf855793a03f7e1b3db7134289 (diff)
downloadchef-64f5dd096d6df9a6425f758326c4aae952551c2d.tar.gz
CHEF-2916: Disable GC in popen4 to avoid mythical Ruby 1.8 IO.select bug
-rw-r--r--chef/lib/chef/mixin/command/unix.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/chef/lib/chef/mixin/command/unix.rb b/chef/lib/chef/mixin/command/unix.rb
index b1176407cf..b63a02663b 100644
--- a/chef/lib/chef/mixin/command/unix.rb
+++ b/chef/lib/chef/mixin/command/unix.rb
@@ -28,6 +28,9 @@ class Chef
#
# Thanks Ara!
def popen4(cmd, args={}, &b)
+ # Ruby 1.8 suffers from intermittent segfaults believed to be due to GC while IO.select
+ # See CHEF-2916 / CHEF-1305
+ GC.disable
# Waitlast - this is magic.
#
@@ -207,6 +210,8 @@ class Chef
else
[cid, pw.last, pr.first, pe.first]
end
+ ensure
+ GC.enable
end
end