NEWS:

Uncategorized 16 Aug 2005 08:16 pm

New fcgi_handler.rb cuts 500 errors (or so)

I’ve gotten rid of the majority of my Rails 500 errors over the last few weeks, but there have continued to be the niggling few that just won’t go away. (Well, also I’ve continued to add new functionality which may be contributing.)

I haven’t had any luck matching these to application errors – they just seem to be processes gone bad.

Today I noticed there’s a new version of fcgi_handler.rb available in the rails svn:

http://dev.rubyonrails.org/svn/rails/trunk/railties/lib/fcgi_handler.rb

This is post rails 0.13.1, and you’ll need 0.13 or newer to use it. From the log message:

“Dropped the ‘immediate close-down’ of FCGI processes since it didn’t work consistently and produced bad responses when it didn’t.” -DHH

I’ve run it (it’s running this site right now) on my test machine and after a couple of hours, when it seemed to be perfectly compatible, on my production machine. I haven’t seen any 500 errors since then, and everything seems to be running fine, so maybe this will clean them up a bit.

Now my fastcgi log looks like this:

[16/Aug/2005:19:57:06 :: 6621] asked to terminate ASAP
[16/Aug/2005:19:57:26 :: 6621] terminated gracefully
[16/Aug/2005:20:38:41 :: 15577] starting
[16/Aug/2005:20:38:45 :: 18456] starting

And those graceful exits don’t correspond to 500 errors.

I haven’t managed to get a process to exit with an error yet, but it looks like we should get more info about the error now:

"Dispatcher failed to catch: #{e} (#{e.class})\n" +
    "  #{e.backtrace.join("\n  ")}\n#{msg}"

I’m actually looking forward to seeing what I get there. On my test server at least.

Comments are closed.