Strange Thread related errors
mguterl at gmail.com
Thu Jan 7 16:32:19 EST 2010
On Thu, Jan 7, 2010 at 3:13 PM, Eric Wong <normalperson at yhbt.net> wrote:
> Michael Guterl <mguterl at gmail.com> wrote:
>> Our Rails app has started raising exceptions (caught by hoptoad
>> thankfully) and I can only imagine they're related to unicorn. I only
>> *think* the errors are occurring on the request after we deploy, which
>> upgrades the Unicorn process. I say this because the errors are
>> coming from many different actions, but I haven't been able to
>> After the most recent batch of errors, I upgraded from 0.95.1 to
>> 0.95.3, but we have not deployed again.
>> ThreadError: stopping only thread note: use sleep to stop forever
>> /usr/local/lib/ruby/1.8/monitor.rb:285:in `stop'
>> /usr/local/lib/ruby/1.8/monitor.rb:285:in `mon_acquire'
>> /usr/local/lib/ruby/1.8/monitor.rb:214:in `mon_enter'
>> /usr/local/lib/ruby/1.8/monitor.rb:240:in `synchronize'
>> /usr/local/lib/ruby/1.8/logger.rb:496:in `write'
>> /usr/local/lib/ruby/1.8/logger.rb:326:in `add'
>> /usr/local/lib/ruby/1.8/logger.rb:374:in `info'
> Hi Michael,
> It looks like there's a background thread with the NewRelic plugin...
> With "preload_app true", then any threads spawned in the master will die
> in workers. This is true for Ruby 1.8 green threads by design. With
> 1.9, it's not even to share native POSIX threads between processes.
> So in your after_fork hook, you need to restart threads inside
> each worker.
Thanks for this Eric, much appreciated. It turns out that New Relic
doesn't officially support Unicorn yet, but I upgraded their plugin
and I have deployed a few times and haven't seen anything since.
More information about the mongrel-unicorn