summaryrefslogtreecommitdiffstats
path: root/lib/puppet/type/k5login.rb
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2009-11-12 23:30:13 -0800
committerJames Turnbull <james@lovedthanlost.net>2009-11-19 11:21:23 +1100
commitbd5dc649ad55fc4724cafad99852b825adfde182 (patch)
tree8d874e3076cdb6fe47d07e7a9201b26f6520190c /lib/puppet/type/k5login.rb
parentc1e47a43df40abd5da04bf147df17f0b53bf0868 (diff)
downloadpuppet-bd5dc649ad55fc4724cafad99852b825adfde182.tar.gz
puppet-bd5dc649ad55fc4724cafad99852b825adfde182.tar.xz
puppet-bd5dc649ad55fc4724cafad99852b825adfde182.zip
Possible workaround for #2824 (MRI GC bug)
This is a moderately ugly workaround for the MRI garbage collection bug (see the ticket for details). I explored several other potential solutions (notably, monkey patching the routines that trigger the bug) but none of them were satisfactory. Monkey patching sub, gsub, sub!, gsub!, etc., for example, either changes the scoping of $~, $1, etc. in a way that could potentially subtly change the meaning of programs or (if you are clever) faithfully reproduces the behaviour of MRI--including the memory leak. I decided to go with the standardized and somewhat obnoxious never- used optional argument as it was easy to automatically insert and should be even easier to automatically find and remove if a better fix is developed. It also should be obtrusive enough to escape accidental removal in refactoring.
Diffstat (limited to 'lib/puppet/type/k5login.rb')
-rw-r--r--lib/puppet/type/k5login.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/type/k5login.rb b/lib/puppet/type/k5login.rb
index 20c03241f..5526fda21 100644
--- a/lib/puppet/type/k5login.rb
+++ b/lib/puppet/type/k5login.rb
@@ -56,7 +56,7 @@ Puppet::Type.newtype(:k5login) do
end
# Return the principals
- def principals
+ def principals(dummy_argument=:work_arround_for_ruby_GC_bug)
if File.exists?(@resource[:name])
File.readlines(@resource[:name]).collect { |line| line.chomp }
else