unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Michael Guterl <mguterl@gmail.com>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: Strange Thread related errors
Date: Thu, 7 Jan 2010 16:32:19 -0500	[thread overview]
Message-ID: <944a03771001071332g19610af6r76ea88cc193a245@mail.gmail.com> (raw)
In-Reply-To: <20100107201340.GA27432@dcvr.yhbt.net>

On Thu, Jan 7, 2010 at 3:13 PM, Eric Wong <normalperson@yhbt.net> wrote:
> Michael Guterl <mguterl@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
>> reproduce.
>> 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'
>> /home/deploy/public_html/rm/releases/20100107153636/vendor/plugins/newrelic_rpm/lib/new_relic/agent/agent.rb:46:in
>> `ensure_worker_thread_started'
> 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.

Michael Guterl
Unicorn mailing list - mongrel-unicorn@rubyforge.org
Do not quote signatures (like this one) or top post when replying

      reply	other threads:[~2010-01-07 21:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-07 16:05 Strange Thread related errors Michael Guterl
2010-01-07 16:31 ` Iñaki Baz Castillo
2010-01-07 18:10   ` Jeremy Evans
2010-01-07 18:33     ` Iñaki Baz Castillo
2010-01-07 18:49   ` Michael Guterl
2010-01-07 19:08     ` Iñaki Baz Castillo
2010-01-07 20:08     ` Jeremy Evans
2010-01-07 20:13 ` Eric Wong
2010-01-07 21:32   ` Michael Guterl [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=944a03771001071332g19610af6r76ea88cc193a245@mail.gmail.com \
    --to=mguterl@gmail.com \
    --cc=mongrel-unicorn@rubyforge.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).