Today we had an interesting experience. During the the deployment one of the server start showing a lot of errors with backtrace ActionController::RoutingError.

It turns out that not all the places in the javascript code checking the status code or the response, and one specific place went into infinite loop (mad-elephant) start sending ajax call one after another when 404 returned

On the server side it shows itself as ActionController::RoutingError with backtrace over and over again, log file grows quickly, server is busy, .... - if nobody monitors log space - then it could run out very quickly. Modern browsers on modern computer with powerfull backend server can process thousands of ajax requests with 404 result

Solution: log ActionController::RoutingError without backtrace

Patch


--- rescue.rb   2008-07-30 15:26:26.000000000 -0400
+++ /rescue_mad_logs_fix.rb    2008-07-30 15:30:13.000000000 -0400
@@ -131,7 +131,7 @@
       # Overwrite to implement custom logging of errors. By default logs as fatal.
       def log_error(exception) #:doc:
         ActiveSupport::Deprecation.silence do
-          if ActionView::TemplateError === exception
+          if ActionView::TemplateError === exception || ActionController::RoutingError === exception
             logger.fatal(exception.to_s)
           else
             logger.fatal(