This project is archived and is in readonly mode.

#1831 ✓resolved
Michael Koziarski

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

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

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

Comments and changes to this ticket

  • Repository

    Repository February 5th, 2009 @ 10:44 PM

    • State changed from “new” to “resolved”

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

  • Justin Coyne

    Justin Coyne November 17th, 2009 @ 04:42 PM

    • 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='

  • Justin Coyne

    Justin Coyne November 17th, 2009 @ 08:57 PM

    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'
    

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Referenced by

Pages