Mike GraftonMike Grafton
New York Standup 11/24/2008
edit Posted by Mike Grafton on Monday November 24, 2008 at 03:05PM

Interesting

  • Rails 2.2.2 is released!

  • Even Rails 2.2.2 isn't always threadsafe. I found this out by running a script with JRuby from the command line. The script loaded the Rails environment and then launched two threads that simply tried to resolve an ActiveRecord class constant. Fireworks (in the form of LoadError) ensued deep inside of const_missing. I'll post the full example later today.

  • Tsearch2 is now built into Postgres (as of 8.3). This means you must remove the metadata from your tables, since Postgres now stores it in a separate place.

Comments

  1. Stephan Kaag Stephan Kaag on November 24, 2008 at 03:42PM

    You do mean Rails 2.2?

  2. Stephan Kaag Stephan Kaag on November 24, 2008 at 03:44PM

    Ah clear now. Rails 2.2.2 indeed.

  3. Mike Perham Mike Perham on November 24, 2008 at 07:16PM

    ActiveSupport's autoloading is not thread-safe. Make sure you are calling config.threadsafe! which disables it.

  4. Mike Grafton Mike Grafton on November 25, 2008 at 01:10AM

    Thanks Mike, it does seem that autoloading is the problem here. I turned it off (as you suggested) and the problem went away - although I was forced to load every ruby file in my /lib directory by hand. I don't grok what's loading the rest of my app classes, but for now it's a mystery I'm willing to live with :)