Issue #4246 has been updated by Michael Stahnke.

Target version changed from 1.6.0 to 1.6.x


----------------------------------------
Bug #4246: Threading issue in Facter initialization
https://projects.puppetlabs.com/issues/4246

Author: Brice Figureau
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: 1.6.x
Keywords: 
Branch: 
Affected Facter version: 


When puppet runs on top of JRuby with a 10 thread concurrency (ie 10 clients 
accessing the master at the exact same time), it seems the first access to 
Facter.value fails with the following stacktrace:

<pre>
/home/brice/devl/jruby/lib/ruby/gems/1.8/gems/facter-1.5.7/lib/facter/util/fact.rb:40:in
 `add'
/home/brice/devl/jruby/lib/ruby/gems/1.8/gems/facter-1.5.7/lib/facter/util/collection.rb:35:in
 `add'
/home/brice/devl/jruby/lib/ruby/gems/1.8/gems/facter-1.5.7/lib/facter.rb:101:in 
`add'
/home/brice/devl/jruby/lib/ruby/gems/1.8/gems/facter-1.5.7/lib/facter/ipaddress.rb:1
/home/brice/devl/jruby/lib/ruby/gems/1.8/gems/facter-1.5.7/lib/facter/ipaddress.rb:73:in
 `load'
/home/brice/devl/jruby/lib/ruby/gems/1.8/gems/facter-1.5.7/lib/facter/util/loader.rb:73:in
 `load_file'
/home/brice/devl/jruby/lib/ruby/gems/1.8/gems/facter-1.5.7/lib/facter/util/loader.rb:16:in
 `load'
/home/brice/devl/jruby/lib/ruby/gems/1.8/gems/facter-1.5.7/lib/facter/util/loader.rb:12:in
 `each'
/home/brice/devl/jruby/lib/ruby/gems/1.8/gems/facter-1.5.7/lib/facter/util/loader.rb:12:in
 `load'
/home/brice/devl/jruby/lib/ruby/gems/1.8/gems/facter-1.5.7/lib/facter/util/collection.rb:69:in
 `fact'
/home/brice/devl/jruby/lib/ruby/gems/1.8/gems/facter-1.5.7/lib/facter/util/collection.rb:114:in
 `value'
/home/brice/devl/jruby/lib/ruby/gems/1.8/gems/facter-1.5.7/lib/facter.rb:85:in 
`value'
/home/brice/devl/puppet/lib/puppet/indirector/catalog/compiler.rb:133:in 
`set_server_facts'
/home/brice/devl/puppet/lib/puppet/indirector/catalog/compiler.rb:130:in `each'
/home/brice/devl/puppet/lib/puppet/indirector/catalog/compiler.rb:130:in 
`set_server_facts'
/home/brice/devl/puppet/lib/puppet/indirector/catalog/compiler.rb:50:in 
`initialize'
/home/brice/devl/puppet/lib/puppet/indirector/indirection.rb:303:in `new'
/home/brice/devl/puppet/lib/puppet/indirector/indirection.rb:303:in 
`make_terminus'
/home/brice/devl/puppet/lib/puppet/indirector/indirection.rb:123:in `terminus'
/home/brice/devl/puppet/lib/puppet/indirector/indirection.rb:291:in `prepare'
/home/brice/devl/puppet/lib/puppet/indirector/indirection.rb:181:in `find'
/home/brice/devl/puppet/lib/puppet/indirector.rb:50:in `find'
/home/brice/devl/puppet/lib/puppet/network/http/handler.rb:101:in `do_find'
/home/brice/devl/puppet/lib/puppet/network/http/handler.rb:68:in `process'
/home/brice/devl/puppet/lib/puppet/network/http/rack.rb:51:in `call'
file:/home/brice/devl/puppet/../jetty-rackup/jars/jruby-rack-0.9.6.jar!/rack/handler/servlet.rb:19:in
 `call'
:1
err: can't modify array during iteration
</pre>

I suspect the facts lazy-loading is not thread-safe.
This happens on the master when the master tries to set its own server facts.

I suspect it isn't possible to trigger the failure with the current MRI because 
of the green thread implementation.

It can be possible to work-around the problem on the puppet side, though.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en.

Reply via email to