unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Cc: Ben Curren <ben@outright.com>
Subject: Re: Unicorn Signal Handling Shared for Other Servers
Date: Mon, 4 Oct 2010 05:41:24 +0000	[thread overview]
Message-ID: <20101004054124.GA31068@dcvr.yhbt.net> (raw)
In-Reply-To: <AANLkTikMSD=-1BwLe_Dtu6ybCOABcFkVk_ZU9pDP2D8K@mail.gmail.com>

Ben Curren <ben@outright.com> wrote:
> I was curious if anyone has attempted to, or is interested, it ripping
> out Unicorn's signal handling and daemon code to make it possible to
> share with other Ruby Servers. I really love have 0 down time deploys
> and would love to have this in workling, thrift or other custom
> servers we have written. I'm more than willing to fork the code and
> take stab at it but wanted to check with the group to see if something
> has already been attempted. I'm not the type who likes to reinvent the
> wheel.

Hi Ben,

I recall some attempts to make libraries around what Unicorn did a year
ago when Unicorn started picking up more press.  I'm not sure how far
any of them got and can't remember the names, but October/November 2009
was the time frame.

Personally, I think the core Ruby methods around Unix APIs are
"just right" and extra wrappers either:

  a) take away needed flexibility
     (no, I don't want umask 0000 with my daemonize())

  b) require as much effort to learn as the Unix APIs
     (Process.daemon() in 1.9, really?)

The Unix APIs themselves are well-documented in manpages, textbooks,
and needless to say, useful outside of Ruby[1].

Ruby already does a great job of hiding the tedious, more painful parts
of the original C APIs from you.  Things like trap(signal, &block),
IO.select, and exceptions (vs writing error check for *everything*)
already make life much easier than before.

For Unicorn (and Rainbows!) development, one huge (maybe the biggest)
factor in trusting it is having integration tests that
start/stop/restart/thrash/nuke the server in various ways a user would.
The test suite hits signal handling logic, directory changes, process
creation/reaping, log file rotation, pid files, etc.  Some parts of the
test suite are ugly (test_exec.rb), but nevertheless effective at
finding bugs.

[1] - I'll admit to being reasonably experienced with Unix programming
      and worked on several daemons before I picked up Ruby.

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

      reply	other threads:[~2010-10-04  5:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-03 22:03 Unicorn Signal Handling Shared for Other Servers Ben Curren
2010-10-04  5:41 ` Eric Wong [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=20101004054124.GA31068@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=ben@outright.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).