ActiveRecord autoloading classes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Jie
Reply | Threaded
Open this post in threaded view
|

ActiveRecord autoloading classes

Jie
In rails/activerecord/lib/active_record.rb, why are some classes autoloaded while other are eager_autoloaded?

Specifically, I'm looking into an error with the message "uninitialized constant ActiveRecord::Core::ClassMethods::StatementCache Did you mean? ActiveRecord::StatementCache". This recently showed up in my Sidekiq process logs, but happens infrequently and I haven't been able to reproduce it. It seems like a concurrency bug with class-loading in ActiveRecord - could it happen when a process gets restarted and multiple threads are trying to load ActiveRecord classes at the same time?

Any pointers would be helpful. Thanks!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ccc0dbcd-0b47-4128-8ce7-e7615a47a3b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ActiveRecord autoloading classes

Joe Guerra
image.png

On Thu, Sep 20, 2018 at 3:20 PM Jie <[hidden email]> wrote:
In rails/activerecord/lib/active_record.rb, why are some classes autoloaded while other are eager_autoloaded?

Specifically, I'm looking into an error with the message "uninitialized constant ActiveRecord::Core::ClassMethods::StatementCache Did you mean? ActiveRecord::StatementCache". This recently showed up in my Sidekiq process logs, but happens infrequently and I haven't been able to reproduce it. It seems like a concurrency bug with class-loading in ActiveRecord - could it happen when a process gets restarted and multiple threads are trying to load ActiveRecord classes at the same time?

Any pointers would be helpful. Thanks!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ccc0dbcd-0b47-4128-8ce7-e7615a47a3b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAOFgAM%3D2Hn0c7Q16DNC-Y8n7v3tLGNchJL-588rSOmWCLaH_iA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.