Does the DRB server need a Mutex lock?

Recently we added more processor cores to the box that holds the
acts_as_ferret drb server and now we are getting this fun:

Mysql::Error: Lost connection to MySQL server during query: SHOW TABLES

It happens in ferret_server.rb’s method_missing:

@logger.debug#method_missing(#{name.inspect}, #{args.inspect})”

I’m starting think we weren’t seeing this before because our system
wasn’t trying to push multiple calls through the DRB server before
because they were getting queued up at the OS level since we didn’t have
enough processors to handle concurrent requests…

This would seem to resemble the database connection problem described
here:

http://wiki.rubyonrails.com/rails/pages/HowTosWorkerThreads

Maybe?

I don’t know much about DRB or this problem yet? But it may appear that
a lock is needed around this thing so that multiple threads aren’t using
the same database connection at the same time until some better thoughts
have come up around making this search multi threaded?

Anyone agree with this assessment? From a cursory glance at DRB docs it
seems DRB objects are multithreaded so its possible to have more than
one thread walk through this thing at the same time…

Probably should be issuing that debug statement differently too or “SHOW
TABLES” is going to get called a lot even for higher logging levels when
the string is evaled?

if @logger.debug?
@logger.debug#method_missing(#{name.inspect}, #{args.inspect})”
end