Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Nov 15, 2011
  1. test_helper: ensure test client connects to valid address

    Jeremy Evans authored Eric Wong committed
    You can listen on, but trying to connect to it doesn't work
    well on OpenBSD.
    Acked-by: Eric Wong <>
  2. t0011: fix test under OpenBSD

    Jeremy Evans authored Eric Wong committed
    expr on OpenBSD uses a basic regular expression (according to
    re_format(7)), which doesn't support +, only *.
    Acked-by: Eric Wong <>
  3. configurator: limit timeout to 30 days

    Eric Wong authored
    There's no practical difference between a timeout of 30 days and
    68 years from an HTTP server standpoint.
    POSIX limits us to 31 days, actually, but there could be
    rounding error with floats used in Ruby time calculations and
    there's no real difference between 30 and 31 days, either...
    Thanks to Jeremy Evans for pointing out large values will throw
    EINVAL (on select(2) under OpenBSD with Ruby 1.9.3 and
    RangeError on older Rubies.
  4. t: ensure SSL certificates exist on fresh test

    Eric Wong authored
    We throw up some fake SSL certs for testing
Commits on Oct 4, 2011
  1. @hotchpotch

    OobGC: force GC.start

    hotchpotch authored Eric Wong committed
    [ew: we need to explicitly enable GC if it is disabled
     and respect applications that disable GC]
    Acked-by: Eric Wong <>
Commits on Sep 15, 2011
  1. add preliminary SSL support

    Eric Wong authored
    This will also be the foundation of SSL support in Rainbows!
    and Zbatery.  Some users may also want to use this in
    Unicorn on LANs to meet certain security/auditing requirements.
    Of course, Nightmare! (in whatever form) should also be able to
    use it.
  2. @bpo

    Detect daemonization via configuration.

    bpo authored Eric Wong committed
    This prevents the stopping of all workers by SIGWINCH if you're
    using a windowing system that will 'exec' unicorn from a process
    that's already in a process group.
    Acked-by: Eric Wong <>
Commits on Sep 9, 2011
  1. Links: add a link to the UnXF middleware

    Eric Wong authored
    Since unicorn is designed to be deployed behind nginx (or
    similar), X-Forwarded-* headers are common and Rack applications
    may blindly trust spoofed X-Forwarded-* headers.  UnXF provides
    a central place for managing that trust by using rpatricia.
  2. http_server: update comment on tick == 0

    Eric Wong authored
    The old comment was confusing.  We only zero the tick counter
    when forking because application loading can take a long time.
    Otherwise, it's always updated.
Commits on Sep 3, 2011
  1. http_server: a few more things eligible for GC in worker

    Eric Wong authored
    There is no need to keep extra hashes or Proc objects around in
    the heap.
Commits on Aug 29, 2011
  1. add GPLv3 option to the license

    Eric Wong authored
    Existing license terms (Ruby-specific) and GPLv2 remain
    in place, but GPLv3 is preferred as it helps with
    distribution of AGPLv3 code and is explicitly compatible
    with Apache License (v2.0).
    Many more reasons are documented by the FSF:
Commits on Aug 25, 2011
  1. unicorn 4.1.1 - fix last-resort timeout accuracy

    Eric Wong authored
    The last-resort timeout mechanism was inaccurate and often
    delayed in activation since the 2.0.0 release.  It is now fixed
    and remains power-efficient in idle situations, especially with
    the wakeup reduction in MRI 1.9.3+.
    There is also a new document on application timeouts
    intended to discourage the reliance on this last-resort
    mechanism.  It is visible on the web at:
  2. doc: add Application Timeouts document

    Eric Wong authored
    Hopefully this leads to fewer worker processes being killed.
Commits on Aug 24, 2011
  1. test_helper: remove needless LOAD_PATH mangling

    Eric Wong authored
    We do it in the Ruby invocation or RUBYLIB.
  2. fix sleep/timeout activation accuracy

    Eric Wong authored
    I've noticed in stderr logs from some folks that (last resort)
    timeouts from the master process are taking too long to activate
    due to the workarounds for suspend/hibernation.
Commits on Aug 22, 2011
  1. .document: re-add OobGC documentation

    Eric Wong authored
Commits on Aug 20, 2011
  1. unicorn 4.1.0 - small updates and fixes

    Eric Wong authored
    * Rack::Chunked and Rack::ContentLength middlewares are loaded
      by default for RACK_ENV=(development|deployment) users to match
      Rack::Server behavior.  As before, use RACK_ENV=none if you want
      fine-grained control of your middleware.  This should also
      help users of Rainbows! and Zbatery.
    * CTL characters are now rejected from HTTP header values
    * Exception messages are now filtered for [:cntrl:] characters
      since application/middleware authors may forget to do so
    * Workers will now terminate properly if a SIGQUIT/SIGTERM/SIGINT
      is received while during worker process initialization.
    * close-on-exec is explicitly disabled to future-proof against
      Ruby 2.0 changes [ruby-core:38140]
  2. rdoc cleanups

    Eric Wong authored
Commits on Aug 19, 2011
  1. close race if an exit signal hits the worker before trap

    Eric Wong authored
    The signal handler from the master is still active and will
    push the pending signal to SIG_QUEUE if a worker receives
    a signal immediately after forking.
  2. gemspec: bump wrongdoc dependency for dev

    Eric Wong authored
    Hopefully it points people towards the mailing list
  3. tests: bump test deps to the latest versions

    Eric Wong authored
    Nothing appears broken :)
  4. Rack::Chunked and ContentLength middlewares by default

    Eric Wong authored
    This is needed to match the behavior of Rack::Server for
    RACK_ENV=(deployment|development), actually.  This won't
    affect users of other RACK_ENV values.
    This change has minor performance consequences, so users
    negatively affected should set RACK_ENV to "none" instead for
    full control of their middleware stack.
    This mainly affects Rainbows!/Zbatery users since they have
    persistent connections and /need/ Content-Length or
    Transfer-Encoding:chunked headers.
  5. filter exception messages with control characters

    Eric Wong authored
    We do not want to affect terminals of users who view our log
Commits on Aug 12, 2011
  1. http_server: small simplification for redirects

    Eric Wong authored
    We only need the fileno in the key which we use
    to generate the UNICORN_FD env.  Otherwise the IO
    object is accepted and understood by Ruby.
Commits on Aug 11, 2011
  1. future-proof against close-on-exec by default

    Eric Wong authored
    Setting the close-on-exec flag by default and closing
    non-standard descriptors is proposed for Ruby 1.9.4/2.0.0.
    Since Unicorn is one of the few apps to rely on FD inheritance
    across exec(), we need to workaround this by redirecting each
    listener FD to itself for Kernel#exec.
    Ruby supports a hash as the final argument to Kernel#exec since
    at least 1.9.1 (nobody cares for 1.9.0 anymore). This allows
    users to backport close-on-exec by default patches to older
    1.9.x installs without breaking anything.
  2. test_socket_helper: Socket#bind may fail with EINVAL if IPv6 is missing

    Eric Wong authored
    I don't build IPv6 into all my kernels; maybe other testers do
    not, either.
Commits on Aug 3, 2011
  1. KNOWN_ISSUES: add link to FreeBSD jail workaround notes

    Eric Wong authored
    Thanks to Tatsuya Ono on the unicorn mailing list.
Commits on Aug 2, 2011
  1. trap death signals in the worker sooner

    Eric Wong authored
    This helps close a race condition preventing shutdown if
    loading the application (preload_app=false) takes a long
    time and the user decides to kil workers instead.
Commits on Jul 20, 2011
  1. http_server: explicitly disable close-on-exec for listeners

    Eric Wong authored
    Future versions of Ruby may change this from the default *nix
    behavior, so we need to explicitly allow FD passing via exec().
Commits on Jul 13, 2011
  1. http: reject non-LWS CTL chars (0..31 + 127) in field values

    Eric Wong authored
    RFC 2616 doesn't appear to allow most CTL bytes even though
    Mongrel always did.  Rack::Lint disallows 0..31, too, though we
    allow "\t" (HT, 09) since it's LWS and allowed by RFC 2616.
Commits on Jul 1, 2011
  1. socket_helper: fix undefined variable for logging

    Eric Wong authored
    I corrupted a Ruby build and SOL_TCP didn't get defined :x
Commits on Jun 29, 2011
  1. unicorn 4.0.1 - regression bugfixes

    Eric Wong authored
    This release fixes things for users of per-worker "listen"
    directives in the after_fork hook.  Thanks to
    for reporting the bug.
    The "timeout" configurator directive is now truncated to
    0x7ffffffe seconds to prevent overflow when calling
  2. configurator: limit timeout to 32-bit INT_MAX-1

    Eric Wong authored
    Nobody will miss one second if they specify an "infinite"
    timeout of ~68 years.  This prevents duplicating this logic
    in Rainbows!
  3. fix per-worker listen directive in after_fork hook

    Eric Wong authored
    The testcase for this was broken, too, so we didn't notice
    this :<
    Reported-by: on the Rainbows! mailing list,
Commits on Jun 27, 2011
  1. configurator: truncate timeouts to 32-bit LONG_MAX

    Eric Wong authored in Ruby can't wait longer than this.  This
    means Unicorn can't support applications that take
    longer than 68 years to respond :(
Something went wrong with that request. Please try again.