[Mongrel] Mongrel spewing backtraces and nanosleeping

Kirk Haines wyhaines at gmail.com
Thu Sep 14 12:04:56 EDT 2006

On 9/14/06, Jacob Atzen <jacob at jacobatzen.dk> wrote:

> How do I get Mongrel to use Mutex?

In your mongrel/rails.rb, right at the beginning:

require 'sync'

Comment that out and add

require 'thread'

Use the thread lib I sent to you, as it should fix the problem that
caused Zed to want to switch from Mutex to Sync in the first place.

Then, just below that, in this code:

    class RailsHandler < Mongrel::HttpHandler
      attr_reader :files
      attr_reader :guard
      @@file_only_methods = ["GET","HEAD"]

      def initialize(dir, mime_map = {})
        @files = Mongrel::DirHandler.new(dir,false)
        @guard = Sync.new

That last line, comment it out and add:

        @guard = Mutex.new

Then try your test again and see if you can reproduce that mode of failure.

Kirk Haines

More information about the Mongrel-users mailing list