Files | Admin

Notes:

Release Name: 4.1.0

Notes:
unicorn 4.1.0 - small updates and fixes

Unicorn is an HTTP server for Rack applications designed to only serve
fast clients on low-latency, high-bandwidth connections and take
advantage of features in Unix/Unix-like kernels.  Slow clients should
only be served by placing a reverse proxy capable of fully buffering
both the the request and response in between Unicorn and slow clients.

* http://unicorn.bogomips.org/
* mongrel-unicorn@rubyforge.org
* git://bogomips.org/unicorn.git
* http://unicorn.bogomips.org/NEWS.atom.xml

Changes:

* 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]



Changes: .document | 9 ++++++++- .wrongdoc.yml | 2 ++ GIT-VERSION-GEN | 2 +- KNOWN_ISSUES | 3 +++ ext/unicorn_http/unicorn_http_common.rl | 5 +++-- lib/unicorn.rb | 13 +++++++++++-- lib/unicorn/const.rb | 2 +- lib/unicorn/http_server.rb | 23 +++++++++++++++++++---- lib/unicorn/socket_helper.rb | 2 +- script/isolate_for_tests | 6 +++--- test/unit/test_http_parser.rb | 18 ++++++++++++++++++ test/unit/test_socket_helper.rb | 6 +++++- unicorn.gemspec | 2 +- 13 files changed, 76 insertions(+), 17 deletions(-) commit 4f33a71dc2e24f0cc59315b49e7a7ffe71f368d3 Author: Eric Wong Date: Fri Aug 19 23:04:30 2011 +0000 unicorn 4.1.0 - small updates and fixes * 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] commit 5a6d4ddd8ea2df799654abadb1e25f3def9d478b Author: Eric Wong Date: Sat Aug 20 00:28:39 2011 +0000 rdoc cleanups commit 8de6ab371c1623669b86a5dfa8703c8fd539011f Author: Eric Wong Date: Fri Aug 19 22:13:04 2011 +0000 close race if an exit signal hits the worker before trap 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. commit f8b22397ca395a9173d391e8699d539503707792 Author: Eric Wong Date: Fri Aug 19 21:55:35 2011 +0000 gemspec: bump wrongdoc dependency for dev Hopefully it points people towards the mailing list commit 86bbb84231a8a16ec54a621c66843b103b5a8610 Author: Eric Wong Date: Fri Aug 19 21:54:37 2011 +0000 tests: bump test deps to the latest versions Nothing appears broken :) commit 1077961a3f8933c65d39c7e6c9ed6ff3b6b53647 Author: Eric Wong Date: Fri Aug 19 20:47:29 2011 +0000 Rack::Chunked and ContentLength middlewares by default 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. commit 7fe08addefb12bd2f4c63901e8cf631e9162ca51 Author: Eric Wong Date: Tue Aug 16 19:44:04 2011 -0700 filter exception messages with control characters We do not want to affect terminals of users who view our log files. commit b1f328b0dd3647168fcc8b1ad9b09284707ad929 Author: Eric Wong Date: Thu Aug 11 17:28:47 2011 -0700 http_server: small simplification for redirects 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. commit 6ab27beeda3b0aaaa66f7cc4f734944a7aa84385 Author: Eric Wong Date: Thu Aug 11 12:59:09 2011 -0700 future-proof against close-on-exec by default 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. ref: http://redmine.ruby-lang.org/issues/5041 commit 60d60a6fa716e91651997d86e3cb9cda41475975 Author: Eric Wong Date: Thu Aug 11 12:46:27 2011 -0700 test_socket_helper: Socket#bind may fail with EINVAL if IPv6 is missing I don't build IPv6 into all my kernels; maybe other testers do not, either. commit ec8a8f32d257290aac377f1c7b1c496e1df75f73 Author: Eric Wong Date: Wed Aug 3 11:00:28 2011 -0700 KNOWN_ISSUES: add link to FreeBSD jail workaround notes Thanks to Tatsuya Ono on the unicorn mailing list. commit 406b8b0e2ed6e5be34d8ec3cd4b16048233c2856 Author: Eric Wong Date: Tue Aug 2 23:52:14 2011 +0000 trap death signals in the worker sooner 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. commit 6d56d7ab891d2cb6127b4cba428a0f7c13b9d2ce Author: Eric Wong Date: Wed Jul 20 22:42:16 2011 +0000 http_server: explicitly disable close-on-exec for listeners Future versions of Ruby may change this from the default *nix behavior, so we need to explicitly allow FD passing via exec(). ref: http://redmine.ruby-lang.org/issues/5041 commit 83f72773b7242d86263a18950fca7c8101d7038d Author: Eric Wong Date: Tue Jul 12 23:52:33 2011 +0000 http: reject non-LWS CTL chars (0..31 + 127) in field values 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. commit cc63e2ee54b4113c40631214618f51c9ef867a91 Author: Eric Wong Date: Fri Jul 1 07:52:31 2011 +0000 socket_helper: fix undefined variable for logging I corrupted a Ruby build and SOL_TCP didn't get defined :x