Permalink
Commits on Nov 3, 2009
Commits on Nov 1, 2009
  1. configurator: add "working_directory" directive

    This basically a prettier way of saying:
    
      Dir.chdir(Unicorn::HttpServer::START_CTX[:cwd] = path)
    
    In the config file.  Unfortunately, this is configuration
    directive where order matters and you should specify it
    before any other path[1] directives if you're using relative
    paths (relative paths are not recommended anyways)
    
    [1] pid, stderr_path, stdout_path
    Eric Wong committed Nov 1, 2009
  2. Do not override Dir.chdir in config files

    Even if START_CTX[:cwd] is pointing to another directory,
    avoid overriding the user's decision to Dir.chdir if they
    do it in either the Unicorn config file or the config.ru.
    Eric Wong committed Nov 1, 2009
  3. cleanup error handling and make it less noisy

    split out uncommon code from the common path
    Eric Wong committed Nov 1, 2009
Commits on Oct 31, 2009
  1. test_signals: avoid portability issues with fchmod(2)

    Just write bytes to the file instead and track its
    size increase instead of its mode.  As of now all
    the unit tests pass under FreeBSD 7.2.
    Eric Wong committed Oct 31, 2009
  2. more portable symlink awareness for START_CTX[:cwd]

    `sh -c pwd` doesn't reliably read ENV["PWD"] on all platforms,
    this means that directories that are symlinks may be ignored
    and the real path is resolved.  This can be problematic when
    doing upgrades for common deployment systems such as Capistrano
    which rely on the working directory being a symlink.
    Eric Wong committed Oct 31, 2009
  3. tests: provide a pure Ruby setsid(8) equivalent

    setsid(8) is non-portable, but we depend on Ruby already and
    it's trivial to implement; so just use the Ruby-only version
    Eric Wong committed Oct 31, 2009
  4. GNUmakefile: fix non-portable tar(1) usage

    Explicitly specify that we mean to use stdin/stdout since
    not all tar(1) implementations default to it.
    Eric Wong committed Oct 31, 2009
  5. test_helper: connect(2) may fail with EINVAL

    Not documented on FreeBSD 7.2, but it seems to happen there
    and searching around, it seems to happen on other systems,
    too...
    Eric Wong committed Oct 31, 2009
Commits on Oct 30, 2009
  1. cleanup: avoid redundant error checks for fstat

    If fstat() fails on an open file descriptor in the master,
    something is seriously wrong (like your kernel is broken/buggy)
    and trying to restart the worker that owned that file descriptor
    is likely masking the symptoms.  Instead let the error propagate
    up to the main loop to avoid wasting cycles to restart broken
    workers.
    Eric Wong committed Oct 30, 2009
Commits on Oct 29, 2009
  1. unicorn 0.93.5

    This release fixes a regression introduced in 0.93.3 where
    timed-out worker processes run a chance of not being killed off
    at all if they're hung.  While it's not ever advisable to have
    requests take a long time, we realize it's easy to fix
    everything :)
    
    Eric Wong (3):
          TODO: remove --kill
          fix reliability of timeout kills
          TODO: update for next version (possibly 1.0-pre)
    Eric Wong committed Oct 29, 2009
  2. TODO: update for next version (possibly 1.0-pre)

    Eric Wong committed Oct 29, 2009
  3. fix reliability of timeout kills

    The method introduced in commit
    6c8a3d3 to avoid killing
    workers after suspend/hibernate interacted badly with the change
    for OpenBSD fchmod(2) compatibility introduced with the 0.93.3
    release.  This interaction lead to workers with files stuck in
    the zero state to never be murdered off for timeout violations.
    
    Additionally, the method to avoid killing processes off was
    never completely reliable and has been reworked even if we
    entered suspend/hibernate/STOP during client processing.
    
    This regression was discovered during continued development of the
    Rainbows! test suite (which we will bring over as it becomes ready).
    Eric Wong committed Oct 29, 2009
  4. TODO: remove --kill

    I'm still having a hard time justifying this...
    Eric Wong committed Oct 29, 2009
Commits on Oct 27, 2009
  1. unicorn 0.93.4

    This release mainly works around BSD stdio compatibility issues
    that affect at least FreeBSD and OS X.  While this issues was
    documented and fixed in [ruby-core:26300][1], no production
    release of MRI 1.8 has it, and users typically upgrade MRI more
    slowly than gems.  This issue does NOT affect 1.9 users.  Thanks
    to Vadim Spivak for reporting and testing this issue and Andrey
    Stikheev for the fix.
    
    Additionally there are small documentation bits, one error
    handling improvement, and one minor change that should improve
    reliability of signal delivery.
    
    Andrey Stikheev (1):
          workaround FreeBSD/OSX IO bug for large uploads
    
    Eric Wong (7):
          DESIGN: address concerns about on-demand and thundering herd
          README: alter reply conventions for the mailing list
          configurator: stop testing for non-portable listens
          KNOWN_ISSUES: document Rack gem issue w/Rails 2.3.2
          stop continually resends signals during shutdowns
          add news bodies to site NEWS.atom.xml
          configurator: fix broken example in RDoc
    
    Suraj N. Kurapati (1):
          show configuration file path in errors instead of '(eval)'
    
    [1] http://redmine.ruby-lang.org/issues/show/2267
    Eric Wong committed Oct 27, 2009
Commits on Oct 25, 2009
  1. workaround FreeBSD/OSX IO bug for large uploads

    Under FreeBSD writing to the file in sync mode does not change current
    position, so change position to the end of the file. Without this patch
    multipart post requests with large data (image uploading) does not work
    correctly:
    
      Status: 500 Internal Server Error
      bad content body
        /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/utils.rb:347:in `parse_multipart'
        /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/utils.rb:319:in `loop'
        /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/utils.rb:319:in `parse_multipart'
    
    File position behavior under FreeBSD  :
    
    ruby -v
    ruby 1.8.7 (2009-04-08 patchlevel 160) [i386-freebsd7]
    
    irb(main):001:0> b  = File.new("abc", "w+")
    => #<File:abc>
    irb(main):002:0>  b.sync = true
    => true
    irb(main):004:0> b.write("abc")
    => 3
    irb(main):005:0> b.pos
    => 0
    
    Acked-by: Eric Wong <normalperson@yhbt.net>
    zsand committed with Eric Wong Oct 25, 2009
Commits on Oct 24, 2009
  1. configurator: fix broken example in RDoc

    Thanks to Greg Melton for reporting.
    Eric Wong committed Oct 24, 2009
Commits on Oct 20, 2009
  1. add news bodies to site NEWS.atom.xml

    While we're at it, remove trailing whitespace for
    author names, too.
    Eric Wong committed Oct 20, 2009
Commits on Oct 19, 2009
  1. stop continually resends signals during shutdowns

    Since our :QUIT and :TERM signal handlers are idempotent, we can
    safely retry sending signals in case workers don't/can't handle
    them them the first time around.  This appears to be a problem
    with the Thread-based concurrency models in Rainbows! not
    behaving well (no surprise, though, since pthreads and signals
    are difficult to manage/mix properly).
    Eric Wong committed Oct 19, 2009
Commits on Oct 16, 2009
  1. KNOWN_ISSUES: document Rack gem issue w/Rails 2.3.2

    In short: upgrade to Rails 2.3.4 (or later)
    
    ref: http://mid.gmane.org/20091014221552.GA30624@dcvr.yhbt.net
    Note: the workaround described in the article above only made
    the issue more subtle and we didn't notice them immediately.
    Eric Wong committed Oct 16, 2009
Commits on Oct 14, 2009
  1. show configuration file path in errors instead of '(eval)'

    also __FILE__ did not reflect configuration file path
    sunaku committed with Eric Wong Oct 14, 2009
Commits on Oct 13, 2009
  1. configurator: stop testing for non-portable listens

    IPv4 addresses in the format of: "^[[:digit:]]+:[[:digit:]]+$"
    isn't very portable..
    Eric Wong committed Oct 13, 2009
  2. README: alter reply conventions for the mailing list

    Mailman is now configured to munge Reply-To: to point back to
    the mailing list.  This might make things easier for folks
    on low traffic mailing lists like ours.
    Eric Wong committed Oct 13, 2009
Commits on Oct 10, 2009
  1. DESIGN: address concerns about on-demand and thundering herd

    Based on a private email I just received.
    Eric Wong committed Oct 10, 2009
Commits on Oct 9, 2009
  1. unicorn 0.93.3

    This release fixes compatibility with OpenBSD (and possibly
    other Unices with stricter fchmod(2) implementations) thanks to
    Jeremy Evans.  Additionally there are small documentation
    changes all around.
    
    Eric Wong (11):
          doc: expand on the SELF_PIPE description
          fchmod heartbeat flips between 0/1 for compatibility
          examples/init.sh: remove "set -u"
          configurator: update with nginx fail_timeout=0 example
          PHILOSOPHY: clarify experience other deployments
          PHILOSOPHY: plug the Rainbows! spin-off project
          README: remove unnecessary and extraneous dash
          DESIGN: clarification and possibly improve HTML validity
          README: remove the "non-existent" part
          README: emphasize the "fast clients"-only part
          drop the whitespace cleaner for Ragel->C
    Eric Wong committed Oct 9, 2009
  2. drop the whitespace cleaner for Ragel->C

    Generated C code is no longer checked into git so it
    doesn't matter.
    Eric Wong committed Oct 9, 2009
  3. README: emphasize the "fast clients"-only part

    While Unicorn is one of very many Unix-only, pre-forking, shared
    socket servers in existence, and Unicorn is _definitely_ not the
    only server that only works *well* with fast clients, either.
    
    But as far as we know, Unicorn is the first (and so far only)
    server that emphasizes only working well with fast clients.
    Eric Wong committed Oct 9, 2009
  4. README: remove the "non-existent" part

    Still pretty rare, though.
    Eric Wong committed Oct 9, 2009
  5. DESIGN: clarification and possibly improve HTML validity

    It's "Ragel+C" (as well as being Ragel->C) because there is C
    code in the parser.  Oddly, validator.w3.org doesn't complain
    about the unescaped ">", but we'll err on the safe side for
    blissful ignorance.
    Eric Wong committed Oct 9, 2009
  6. README: remove unnecessary and extraneous dash

    Eric Wong committed Oct 9, 2009
  7. PHILOSOPHY: plug the Rainbows! spin-off project

    Eric Wong committed Oct 9, 2009
  8. PHILOSOPHY: clarify experience other deployments

    I've only served in an advisory role in most of those instances
    and I relied on feedback from other folks (especially for Tomcat
    since I know almost nothing about that).
    Eric Wong committed Oct 9, 2009
  9. configurator: update with nginx fail_timeout=0 example

    It has come to our attention that this setting is not very
    well-known to the rest of the world...
    Eric Wong committed Oct 9, 2009
  10. examples/init.sh: remove "set -u"

    It's too simple of a script and causes running the init script
    with zero arguments to fail instead of printing out the usage
    message.
    Eric Wong committed Oct 9, 2009
  11. fchmod heartbeat flips between 0/1 for compatibility

    This removes the Time.now.to_i comparison that was used to avoid
    multiple, no-op fchmod() syscalls[1] within the same second.
    
    This should allow us to run on OpenBSD where it can raise EINVAL
    when Time.now.to_i is passed to it.
    
    Reported-by: Jeremy Evans <jeremyevans0@gmail.com>
    
    [1] - gettimeofday() from Time.now is not a real syscall on
    VDSO-enabled x86_64 GNU/Linux systems where Unicorn is primarily
    developed.
    Eric Wong committed Oct 9, 2009