Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Make sure all autoload constants are pulled in when using config.threadsafe!

#1831

As you can never rely on constants being defined while requests are being processed

Reported by Michael Koziarski · February 1st, 2009 @ 02:15 AM

State: resolved
Milestone: none
Assigned to: Michael Koziarski Michael Koziarski
Importance: none

Activity

  1. Repository
    Repository
    • State changed from new to resolved

    (from [c96382a71a77505ea2f51e43bc81fdb3ac95d117]) Make sure all autoload constants are pulled in when using config.threadsafe! [#1831 Make sure all autoload constants are pulled in when using config.threadsafe! state:resolved] http://github.com/rails/rails/co...

    February 5th, 2009 @ 10:44 PM

  2. Justin Coyne
    Justin Coyne
    • Assigned user changed from josh to Michael Koziarski

    I'm running a multithreaded rake task under jruby and I think I've found an intermittent error where ActiveSupport::Multibyte is not getting preloaded when config.threadsafe! is set:

    rake aborted!
    uninitialized constant ActiveSupport::Multibyte
    /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in const_missing' /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2503:inconst_missing' /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/quoting.rb:10:in quote' /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/jdbc_adapter/jdbc_mysql.rb:87:inquote' /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2993:in quote_value' /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2507:inquoted_id' /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations/association_proxy.rb:275:in owner_quoted_id' /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations/has_and_belongs_to_many_association.rb:98:inconstruct_sql' /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations/association_collection.rb:21:in initialize' /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations/has_and_belongs_to_many_association.rb:5:ininitialize' /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations.rb:1297:in new' /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations.rb:1297:inflags' /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations.rb:1321:in flags='

    November 17th, 2009 @ 04:42 PM

  3. Justin Coyne
    Justin Coyne

    I've also hit upon this with HTML::Tokenizer inside of actioncontroller

    uninitialized constant HTML::Tokenizer
    /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/class/inheritable_attributes.rb:113:in `const_missing'
    /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing'
    /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/vendor/html-scanner/html/sanitizer.rb:14:in `tokenize'
    /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/vendor/html-scanner/html/sanitizer.rb:5:in `sanitize'
    /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/vendor/html-scanner/html/sanitizer.rb:30:in `sanitize'
    

    November 17th, 2009 @ 08:57 PM