This stopped working rather recently. NoMethodError in <controller not set>#<action not set> undefined method `verify!' for {}:Hash RAILS_ROOT: script/../config/.. Application Trace | Framework Trace | Full Trace ./script/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in `verify_connection_cache!' ./script/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in `verify_connection_cache!' ./script/../config/../vendor/rails/railties/lib/dispatcher.rb:70:in `prepare_application' ./script/../config/../vendor/rails/railties/lib/dispatcher.rb:37:in `dispatch' ./script/../config/../vendor/rails/railties/lib/webrick_server.rb:117:in `handle_dispatch' ./script/../config/../vendor/rails/railties/lib/webrick_server.rb:83:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start' ./script/../config/../vendor/rails/railties/lib/webrick_server.rb:69:in `dispatch' ./script/../config/../vendor/rails/railties/lib/commands/servers/webrick.rb:59 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:149:in `require' ./script/../config/../vendor/rails/railties/lib/commands/server.rb:28 script/server:3 ./script/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in `verify_connection_cache!' ./script/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in `verify_connection_cache!' ./script/../config/../vendor/rails/railties/lib/dispatcher.rb:70:in `prepare_application' ./script/../config/../vendor/rails/railties/lib/dispatcher.rb:37:in `dispatch' ./script/../config/../vendor/rails/railties/lib/webrick_server.rb:117:in `handle_dispatch' ./script/../config/../vendor/rails/railties/lib/webrick_server.rb:83:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start' ./script/../config/../vendor/rails/railties/lib/webrick_server.rb:69:in `dispatch' ./script/../config/../vendor/rails/railties/lib/commands/servers/webrick.rb:59 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:149:in `require' ./script/../config/../vendor/rails/railties/lib/commands/server.rb:28 script/server:3 ./script/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in `verify_connection_cache!' ./script/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in `verify_connection_cache!' ./script/../config/../vendor/rails/railties/lib/dispatcher.rb:70:in `prepare_application' ./script/../config/../vendor/rails/railties/lib/dispatcher.rb:37:in `dispatch' ./script/../config/../vendor/rails/railties/lib/webrick_server.rb:117:in `handle_dispatch' ./script/../config/../vendor/rails/railties/lib/webrick_server.rb:83:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start' ./script/../config/../vendor/rails/railties/lib/webrick_server.rb:69:in `dispatch' ./script/../config/../vendor/rails/railties/lib/commands/servers/webrick.rb:59 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:149:in `require' ./script/../config/../vendor/rails/railties/lib/commands/server.rb:28 script/server:3 Request _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Feb 27, 2006, at 4:04 PM, Kyle Maxwell wrote:> This stopped working rather recently. > > > NoMethodError in <controller not set>#<action not set> > > undefined method `verify!'' for {}:Hash > > RAILS_ROOT: script/../config/.. > Application Trace | Framework Trace | Full Trace > > ./script/../config/../vendor/rails/activerecord/lib/active_record/ > connection_adapters/abstract/connection_specification.rb:71:in > `verify_connection_cache!''Very recently! See http://dev.rubyonrails.org/ticket/3979 jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (Darwin) iD8DBQFEA5Y0AQHALep9HFYRAr1zAKCkV3MrB51aFPi1DMwDyIIN6l1pVgCgq9Zs lh6op/afDzcShgNwYzwUt3w=HjA9 -----END PGP SIGNATURE-----
Jeremy Kemper wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Feb 27, 2006, at 4:04 PM, Kyle Maxwell wrote: >> This stopped working rather recently. >> >> >> NoMethodError in <controller not set>#<action not set> >> >> undefined method `verify!'' for {}:Hash >> >> RAILS_ROOT: script/../config/.. >> Application Trace | Framework Trace | Full Trace >> >> ./script/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in >> >> `verify_connection_cache!'' > > Very recently! > > See http://dev.rubyonrails.org/ticket/3979 > > jeremy >I usually don''t run my application under webrick and didn''t test it with ticket 3979. However, after doing so, I can''t reproduce this problem with current trunk. -- stefan -- For rails performance tuning, see: http://railsexpress.de/blog Subscription: http://railsexpress.de/blog/xml/rss20/feed.xml
On 2/28/06, Stefan Kaes <skaes@gmx.net> wrote:> Jeremy Kemper wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > On Feb 27, 2006, at 4:04 PM, Kyle Maxwell wrote: > >> This stopped working rather recently. > >> > >> > >> NoMethodError in <controller not set>#<action not set> > >> > >> undefined method `verify!' for {}:Hash > >> > >> RAILS_ROOT: script/../config/.. > >> Application Trace | Framework Trace | Full Trace > >> > >> ./script/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in > >> > >> `verify_connection_cache!' > > > > Very recently! > > > > See http://dev.rubyonrails.org/ticket/3979 > > > > jeremy > > > I usually don't run my application under webrick and didn't test it with > ticket 3979. However, after doing so, I can't reproduce this problem > with current trunk.I can reproduce this problem with my (very) basic toy application. Running Windows XP/Webrick/SQL Server. I'll see if I can locate the cause.. Tom Ward _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
> I can reproduce this problem with my (very) basic toy application. > Running Windows XP/Webrick/SQL Server. I''ll see if I can locate the > cause..Ditto. I run into the same issue under Debian/Lighttpd/SCGI/Oracle.
On 2/28/06, Michael Schoen <schoenm@earthlink.net> wrote:> > I can reproduce this problem with my (very) basic toy application. > > Running Windows XP/Webrick/SQL Server. I'll see if I can locate the > > cause.. > > Ditto. I run into the same issue under Debian/Lighttpd/SCGI/Oracle.I've narrowed it down to the allow_concurrency flag. When starting webrick in development mode, on the first call to ActiveRecord::Base.connection_cache, allow_concurrency is true, whilst for subsequent calls it is false. The first call (with allow_concurrency = true) creates a hash {<thread_id> => {}} but just returns an empty hash. Subsequent calls (with allow_concurrency false) returns the entire hash (including the thread_id bit) which verify_connections! can't cope with. I'm not sure why the flag is true when webrick boots, so that needs to be investigated. A second line of attack is the allows_concurrency flag itself. I can't think when you'd ever want it to be false. I can't see the harm in having concurrency support, even in single-threaded applications. All turning it off allows you, is to share the same connection across multiple threads, but as provided, this wouldn't be thread-safe in any case. Assuming allow_concurrency is always true fixes this issue, but there may be applications I haven't thought of that will be adversely affected. Thoughts? Tom Ward _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
Tom Ward wrote:> On 2/28/06, Michael Schoen <schoenm@earthlink.net> wrote: > >>> I can reproduce this problem with my (very) basic toy application. >>> Running Windows XP/Webrick/SQL Server. I''ll see if I can locate the >>> cause.. >>> >> Ditto. I run into the same issue under Debian/Lighttpd/SCGI/Oracle. >> > > I''ve narrowed it down to the allow_concurrency flag. > > When starting webrick in development mode, on the first call to > ActiveRecord::Base.connection_cache, allow_concurrency is true, whilst > for subsequent calls it is false. The first call (with > allow_concurrency = true) creates a hash {<thread_id> => {}} but just > returns an empty hash. Subsequent calls (with allow_concurrency > false) returns the entire hash (including the thread_id bit) which > verify_connections! can''t cope with. >Nice sleuthing. The problem is caused by the line ActiveRecord::Base.threaded_connections = false in webrick_server.rb It shouldn'' be there, IMO. Comment out the line, and your app will fly again.> I''m not sure why the flag is true when webrick boots, so that needs to > be investigated. >True is the default for ActiveRecord, for historical reasons.> A second line of attack is the allows_concurrency flag itself. I > can''t think when you''d ever want it to be false.FCGI is single threaded. By having the flag, we can optimize AR for single threaded apps.> I can''t see the harm > in having concurrency support, even in single-threaded applications. > All turning it off allows you, is to share the same connection across > multiple threads, but as provided, this wouldn''t be thread-safe in any > case. Assuming allow_concurrency is always true fixes this issue, but > there may be applications I haven''t thought of that will be adversely > affected. Thoughts? >-- stefan -- For rails performance tuning, see: http://railsexpress.de/blog Subscription: http://railsexpress.de/blog/xml/rss20/feed.xml
On 2/28/06, Stefan Kaes <skaes@gmx.net> wrote:> Tom Ward wrote:> > A second line of attack is the allows_concurrency flag itself. I > > can't think when you'd ever want it to be false.> FCGI is single threaded. By having the flag, we can optimize AR for > single threaded apps.True, but to me the existing optimization extremely premature. With allow_concurrency = true @connection_cache is a hash of hashes, while when false its just a single hash. The only saving (when running single threaded) is a single hash lookup. This can't be worth the extra complication in the code, can it? Tom Ward _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Feb 28, 2006, at 9:12 AM, Tom Ward wrote:> On 2/28/06, Stefan Kaes <skaes@gmx.net> wrote: >> Tom Ward wrote: >>> A second line of attack is the allows_concurrency flag itself. I >>> can''t think when you''d ever want it to be false. >> FCGI is single threaded. By having the flag, we can optimize AR for >> single threaded apps. > > True, but to me the existing optimization extremely premature. With > allow_concurrency = true @connection_cache is a hash of hashes, while > when false its just a single hash. The only saving (when running > single threaded) is a single hash lookup. This can''t be worth the > extra complication in the code, can it?I agree, Tom, particularly when we pay the price in brittle code. For now, I''m removing the setting from the webrick server so folks can continue working with trunk. I''d like to see allow_concurrency wiped out. Best, jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (Darwin) iD8DBQFEBJ4QAQHALep9HFYRAsVCAJ93dpY8dOwyqypoqDyQWMw4UcSUpwCfTv5H +B4cSCukjurm3euWZBo+8Sg=KNlX -----END PGP SIGNATURE-----
On 2/28/06, Jeremy Kemper <jeremy@bitsweat.net> wrote:> For now, I'm removing the setting from the webrick server so folks > can continue working with trunk.That's great, certainly the pragmatic solution.> I'd like to see allow_concurrency wiped out.Perhaps that's best left until after 1.1, as part of a more general connection management cleanup. Tom _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
Tom Ward wrote:> On 2/28/06, Jeremy Kemper <jeremy@bitsweat.net> wrote: > > >> For now, I''m removing the setting from the webrick server so folks >> can continue working with trunk. >> > > That''s great, certainly the pragmatic solution. >Please try http://dev.rubyonrails.org/attachment/ticket/3979/connection_cache_bug.patch This should fix all problems.>> I''d like to see allow_concurrency wiped out. >>I don''t want this flag removed. There is a measurable performance difference, at least for my app. See data attached to http://dev.rubyonrails.org/ticket/3979 -- stefan -- For rails performance tuning, see: http://railsexpress.de/blog Subscription: http://railsexpress.de/blog/xml/rss20/feed.xml
Stefan Kaes wrote:> Please try > http://dev.rubyonrails.org/attachment/ticket/3979/connection_cache_bug.patch > > This should fix all problems.Please use http://dev.rubyonrails.org/attachment/ticket/3979/connection_cache_bug2.patch some private methods had to be changed to public to satisfy AR tests. --stefan -- For rails performance tuning, see: http://railsexpress.de/blog Subscription: http://railsexpress.de/blog/xml/rss20/feed.xml
Stefan Kaes wrote:> Stefan Kaes wrote: >> Please try >> http://dev.rubyonrails.org/attachment/ticket/3979/connection_cache_bug.patch >> >> This should fix all problems. > > Please use > http://dev.rubyonrails.org/attachment/ticket/3979/connection_cache_bug2.patchPatch works for me, thanks. And it turns out that under SCGI it''s required to set allow_concurrency = false to avoid using way more connections than makes sense.
I'm on revision 3745, and every few minutes, I have to restart Webrick. Trace follows: uninitialized class variable @@connection_cache_timeout in ActiveRecord::Base RAILS_ROOT: script/../config/.. Application Trace | Framework Trace | Full Trace ./script/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:75:in `verify_active_connections!' ./script/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:74:in `verify_active_connections!' ./script/../config/../vendor/rails/railties/lib/dispatcher.rb:70:in `prepare_application' ./script/../config/../vendor/rails/railties/lib/dispatcher.rb:37:in `dispatch' ./script/../config/../vendor/rails/railties/lib/webrick_server.rb:115:in `handle_dispatch' ./script/../config/../vendor/rails/railties/lib/webrick_server.rb:81:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start' ./script/../config/../vendor/rails/railties/lib/webrick_server.rb:67:in `dispatch' ./script/../config/../vendor/rails/railties/lib/commands/servers/webrick.rb:59 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:149:in `require' ./script/../config/../vendor/rails/railties/lib/commands/server.rb:28 script/server:3 _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
I''ve got the same thing happening on each page load. -- Duane On Mar 2, 2006, at 12:57 PM, Kyle Maxwell wrote:> I''m on revision 3745, and every few minutes, I have to restart > Webrick. Trace follows: > > > > uninitialized class variable @@connection_cache_timeout in > ActiveRecord::Base > > RAILS_ROOT: script/../config/.. > Application Trace | Framework Trace | Full Trace > > ./script/../config/../vendor/rails/activerecord/lib/active_record/ > connection_adapters/abstract/connection_specification.rb:75:in > `verify_active_connections!'' > ./script/../config/../vendor/rails/activerecord/lib/active_record/ > connection_adapters/abstract/connection_specification.rb:74:in > `verify_active_connections!'' > ./script/../config/../vendor/rails/railties/lib/dispatcher.rb:70:in > `prepare_application'' > ./script/../config/../vendor/rails/railties/lib/dispatcher.rb:37:in > `dispatch'' > ./script/../config/../vendor/rails/railties/lib/webrick_server.rb: > 115:in > `handle_dispatch'' > ./script/../config/../vendor/rails/railties/lib/webrick_server.rb: > 81:in > `service'' > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' > /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'' > ./script/../config/../vendor/rails/railties/lib/webrick_server.rb: > 67:in > `dispatch'' > ./script/../config/../vendor/rails/railties/lib/commands/servers/ > webrick.rb:59 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in > `require'' > ./script/../config/../vendor/rails/activesupport/lib/active_support/ > dependencies.rb:149:in > `require'' > ./script/../config/../vendor/rails/railties/lib/commands/server.rb:28 > script/server:3 > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core
I had the same problem this morning. Looks like it was introduced in changeset 3729, when ConnectionSpecification class variable @@connection_cache_timeout was replaced with a variable named @@verification_timeout. Reverting to 3728 cleared it up for me. David On Mar 2, 2006, at 1:10 PM, Duane Johnson wrote:> I''ve got the same thing happening on each page load. > > -- Duane > > On Mar 2, 2006, at 12:57 PM, Kyle Maxwell wrote: > >> I''m on revision 3745, and every few minutes, I have to restart >> Webrick. Trace follows: >> >> >> >> uninitialized class variable @@connection_cache_timeout in >> ActiveRecord::Base >> >> RAILS_ROOT: script/../config/.. >> Application Trace | Framework Trace | Full Trace >> >> ./script/../config/../vendor/rails/activerecord/lib/active_record/ >> connection_adapters/abstract/connection_specification.rb:75:in >> `verify_active_connections!'' >> ./script/../config/../vendor/rails/activerecord/lib/active_record/ >> connection_adapters/abstract/connection_specification.rb:74:in >> `verify_active_connections!'' >> ./script/../config/../vendor/rails/railties/lib/dispatcher.rb:70:in >> `prepare_application'' >> ./script/../config/../vendor/rails/railties/lib/dispatcher.rb: >> 37:in `dispatch'' >> ./script/../config/../vendor/rails/railties/lib/webrick_server.rb: >> 115:in >> `handle_dispatch'' >> ./script/../config/../vendor/rails/railties/lib/webrick_server.rb: >> 81:in >> `service'' >> /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' >> /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' >> /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' >> /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' >> /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'' >> /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'' >> /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'' >> /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'' >> ./script/../config/../vendor/rails/railties/lib/webrick_server.rb: >> 67:in >> `dispatch'' >> ./script/../config/../vendor/rails/railties/lib/commands/servers/ >> webrick.rb:59 >> /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in >> `require'' >> ./script/../config/../vendor/rails/activesupport/lib/ >> active_support/dependencies.rb:149:in >> `require'' >> ./script/../config/../vendor/rails/railties/lib/commands/server.rb:28 >> script/server:3 >> _______________________________________________ >> Rails-core mailing list >> Rails-core@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-core > > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core
Duane Johnson wrote:> I''ve got the same thing happening on each page load. >See ticket http://dev.rubyonrails.org/ticket/4044 -- For rails performance tuning, see: http://railsexpress.de/blog Subscription: http://railsexpress.de/blog/xml/rss20/feed.xml