unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eirik Dentz Sinclair <eirik@efficiency20.com>
To: mongrel-unicorn@rubyforge.org
Cc: tech <tech@efficiency20.com>
Subject: Unicorn fails to restart gracefully on capistrano deploy
Date: Thu, 9 Sep 2010 16:28:19 -0700	[thread overview]
Message-ID: <162ABE91-E653-45BE-B611-AF6C2B37CC4B@efficiency20.com> (raw)

First off thanks very much for all the hard work on unicorn. Alas, we've encountered an issue where unicorn fails to spawn new workers that have loaded the incoming revision on a capistrano deploy. I'm not entirely sure the issue is due to unicorn as it appears that bundler was responsible for a similar issue in the past: http://github.com/carlhuda/bundler/issues/issue/259/#comment_180830

But presumably bundler has corrected that issue and any help in sorting out the issue would be greatly appreciated. 

We are following EngineYard's instructions for loading unicorn via bundle exec: http://docs.engineyard.com/appcloud/howtos/cutomization/customize-unicorn

So far we've tried deploying with the unicorn config set to both "preload_app true" and "preload_app false".
(unicorn.rb being used: https://gist.github.com/9a208e3d1d1e44161018)

When "preload_app true" is used the "uninitialized constant Prefix::OurCustomApi (NameError)" log entry/stacktrace appears once. And the workers never load the incoming code. So while the incoming code is in place and the symlinks are all updated we're still running the previous revision until a unicorn stop/start or reload is sent.

When "preload_app false" is used the "uninitialized constant Prefix::OurCustomApi (NameError)" log entry/stacktrace is written to the unicorn.stderr.log continuously as it keeps trying to respawn workers in a loop. This goes on until a unicorn stop command is sent. Then a unicorn start can be used to load the incoming revision successfully.

The common deployment stack and versions follow:

Capistrano 2.5.19
Bundler 1.0.0rc6
Rails 2.3.8
Unicorn 1.0.1 (tested under unicorn 1.1.3 with same results)

The deployments differ as follows:

The deployed versioned directory is 20100830230613
The incoming versioned directory is 20100902192111

Code in version 20100830230613 uses our_custom_api.gem version 1.0 via the Gemfile
Code in version 20100830230613 uses the constant OurCustomApi in config/initializers/our_custom_api.rb

Code in version 20100902192111 uses prefix_our_custom_api.gem version 2.0 via the Gemfile
Code in version 20100902192111 uses the constant Prefix::OurCustomApi in config/initializers/our_custom_api.rb

The relevant relevant unicorn.stderr.log can be found below and appear to show some sort of issue where both versioned directories are being loaded into the same process?

Unicorn 1.0.1:

Unicorn 1.1.3:

Thanks in advance,

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

             reply	other threads:[~2010-09-09 23:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-09 23:28 Eirik Dentz Sinclair [this message]
2010-09-10  0:19 ` Unicorn fails to restart gracefully on capistrano deploy Jamie Wilkinson
2010-09-10  1:16   ` Lawrence Pit
2010-09-15  6:40 Eirik Dentz Sinclair
2010-09-15 21:52 ` Eric Wong

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=162ABE91-E653-45BE-B611-AF6C2B37CC4B@efficiency20.com \
    --to=eirik@efficiency20.com \
    --cc=mongrel-unicorn@rubyforge.org \
    --cc=tech@efficiency20.com \


* 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).